A script for Obsidian to fetch LeetCode problems as notes. This script uses the Templater plugin.
demo.mp4
- Move
templates/templateLeetcode.mdto the template folder. - Move
scripts/getLeetcodeProblem.jsto the script folder.
Template and script folders are set in Templater settings.
- Copy the problem's URL.
- Create a new note.
- Run the
templateLeetcodetemplate from the Templater: Open insert template modal command. - Watch the note get filled out with the content of the problem.
Tip
You can create keyboard shortcuts for this Templater script.
If the problem contains images, they will be downloaded in the assets/leetcode_imgs folder.
You can modify the template to change this folder or disable image downloading.