LeetCode template

by fennr
5
4
3
2
1
New Plugin

Description

This plugin has not been manually reviewed by Obsidian staff. Generate LeetCode problem templates in your notes.

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
0
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

LeetCode Template

An Obsidian plugin that creates a structured note from a LeetCode problem link or number. It fetches metadata, the problem description, similar questions, and your accepted solution(s).

Features

  • Create note from LeetCode link — prompts for a URL or problem number, fetches metadata, description, and solutions, then creates a note in your target folder.
  • Import solution for current problem — reads the link field from the active note's frontmatter and appends new accepted solutions without duplicates.
  • Custom filename template ({{number}}, {{slug}}, {{title}}) and target folder.
  • Optional problem description and all accepted solutions (or only the latest one).
  • Auto-generated sections: frontmatter, Description, My idea, Optimal solution, Similar questions (optional), Solutions.

Requirements

  • Obsidian 1.5.0+
  • LeetCode cookies: csrftoken and LEETCODE_SESSION (required for GraphQL requests)

Installation and build

bun install
bun run build

Copy main.js and manifest.json into .obsidian/plugins/leetcode-template/ and reload the plugin.

versions.json stays in the repository root for compatibility with older Obsidian versions and is not included in GitHub Releases.

Settings

  • CSRF tokencsrftoken cookie value from leetcode.com
  • LeetCode sessionLEETCODE_SESSION cookie value from leetcode.com
  • Notes folder — target folder for new notes (can be empty)
  • Filename template — placeholders: {{number}}, {{slug}}, {{title}}
  • Include description — include or skip the problem description
  • Insert all solutions — insert all accepted solutions instead of only the latest
  • Languageen / ru; switches commands, notices, modal text, and template labels

Usage

  1. Open the command palette and run a plugin command.
  2. To import solutions, make sure the active note's frontmatter contains link: https://leetcode.com/problems/.../.

Note format

Frontmatter includes title, number, difficulty, tags, and link. Body sections: Description, My idea, Optimal solution, optional Similar questions, and Solutions with code, runtime, and memory. Duplicate solutions are removed; new ones are appended to the Solutions section.

Русский

Плагин создаёт заметку по ссылке или номеру задачи LeetCode: подтягивает метаданные, описание, похожие задачи и Accepted-решения. Команды и интерфейс доступны на русском — включите Language: ru в настройках.