[^1] footnote syntax support to VS Code's Markdown editor and preview.
The extension icon and README emblem use Moon Dancer's purple-crescent-and-three-pink-stars cutie mark. The editable vector artwork is in assets/moondancer-cutie-mark.svg.
This repository is a maintained fork of houkanshan/vscode-markdown-footnote by Mai Hou. The upstream work was distributed under the MIT License; its original copyright and permission notice are retained in
LICENSE-base. This fork and its modifications are distributed under the GNU Affero General Public License version 3 or, at your option, any later version; seeLICENSE.
Moondancer can display local .pdf documents through the existing local checkout
of PDF-magic/viewer. The viewer's built
JavaScript, CSS, PDF.js worker, images, and navigation features are loaded from
that checkout at runtime; Moondancer does not vendor or fork the viewer.
Build the reader in its own checkout once:
cd /path/to/PDF-magic/viewer
npm install
npm run buildSet Moondancer: PDF Viewer Checkout (moondancer.pdfViewerCheckout)
to the reader repository directory (not its dist directory). When unset,
Moondancer checks common sibling and home paths. Rebuild the viewer there
after changing its source, then reopen the PDF tab to use the new build.
Opening a local .pdf file creates a native VS Code editor tab using the
PDF-magic UI. To open a remote PDF in its own editor tab, run
Open Web PDF with PDF-magic from the Command Palette and supply its URL.
The extension host downloads remote PDFs without forwarding your browser
cookies or authentication tokens; protected websites may refuse the request.
Local and remote PDFs are read-only. Each editor tab has its own viewer state.
The VS Code adapter supplies document bytes and translates existing reader asset URLs; Chrome-only MIME interception and native-messaging enhancement aren't available in the VS Code webview. Browser use is unaffected, and PDF-magic remains the single source of viewer code.
-
Hover to preview and jump between footnote reference and content by cmd / ctrl + click.
-
Peek editor for quick editing and preview.
-
Command for inserting new footnote
-
Quickly scaffold a numbered footnote from the caret with cmd + shift + 6 on macOS or ctrl + shift + 6 elsewhere. Moondancer inserts the next available
[^n]reference, appends the matching[^n]:definition, and moves the cursor to the definition so you can type immediately. -
Blockquote selected Markdown with cmd + . on macOS or ctrl + . on Windows/Linux. The Blockquote Selection command prefixes each selected line with
>(or>for blank lines) in a single undoable edit. It quotes full lines, handles multiple selections without duplicates, and leaves an unselected line after a trailing newline alone. This shortcut works only for selected Markdown text and can be turned off in Settings usingvscode-markdown-footnote.blockquoteSelectionShortcut(enabled by default). With no selection or the option disabled, the existing Quick Fix shortcut remains available. You can also remap the command from Keyboard Shortcuts. -
Edit footnotes in a synchronized side editor. Run Open Footnote Editor to keep the current Markdown file's footnotes open beside your draft. Inserting a new footnote keeps the Markdown cursor at the reference and moves focus directly to the new footnote in the side editor. The side editor remembers its scroll/cursor position, and new definitions are placed beside the last footnote you were editing instead of always being appended to the end. Multiline footnote content is supported, including indented continuation lines, as originally requested in upstream PR #14.
-
Optionally store footnote definitions in a separate sibling file. Enable
vscode-markdown-footnote.separateFootnoteFileto keep references such as[^1]in the source document while definitions are read from and written tofootnotes.md. The definition file is created automatically when a footnote is first inserted.vscode-markdown-footnote.footnoteFileNamecan change the file name. Hover, go-to-definition, reference lookup, clickable links, and the synchronized side editor follow the definitions across files. -
Spellcheck highlighted Markdown from VS Code's lightbulb / Quick Fix menu. Spellcheck selection with Spellcheck Only opens ChatGPT with the selected text addressed to the installed
@Spellcheck Onlyplugin. The plugin name can be changed withvscode-markdown-footnote.spellcheckPluginName. -
Optionally make Enter exit closing punctuation in Markdown. Enable
vscode-markdown-footnote.skipClosingPunctuationOnEnter(off by default) to move the caret past an immediately following),], or}instead of inserting a newline. If no closer follows the caret, Enter keeps its normal behavior. Suggestions, snippet editing, and rename prompts retain their original Enter handling. With multiple cursors, all cursors must precede a closing delimiter to skip; otherwise Enter inserts a newline normally. -
Render footnotes in the built-in markdown preview.
Separate-file storage is opt-in and defaults to off, so existing Markdown documents keep their current same-file behavior. VS Code's built-in Markdown preview only receives the source document text, so external definitions are not currently merged into preview rendering; editor navigation and the Footnotes side editor do resolve them.
- Support
pandoc-citeprocformat citations
This fork does not need to be published to the VS Code Marketplace. You can run it directly from the source checkout while developing, or package it as a local .vsix and install it into your normal VS Code profile.
Install:
- Visual Studio Code
- Git
- Node.js with npm
git clone https://github.com/pony-factor/moondancer-FN.git
cd moondancer-FN
npm installnpx tsc -p .The compiled JavaScript is written to the out/ directory.
Open the repository in VS Code:
code .Then press F5, or open Run and Debug and choose Run Extension.
VS Code will compile the extension and open a separate Extension Development Host window with this checkout loaded. You can test the extension there without installing or publishing anything.
After changing the source, stop the development host and press F5 again to rebuild and relaunch it.
Package the current checkout as a local VS Code extension:
npx vsce package --out markdown-footnote-local.vsixInstall that file:
code --install-extension markdown-footnote-local.vsix --forceIf the code command is not available in your shell, open VS Code, go to the Extensions view, open the ... menu, choose Install from VSIX..., and select markdown-footnote-local.vsix.
Reload VS Code after installation if prompted.
To replace the locally installed copy with a new build:
npx tsc -p .
npx vsce package --out markdown-footnote-local.vsix
code --install-extension markdown-footnote-local.vsix --forceNo Marketplace publishing step is required.
- File bugs and feature requests in GitHub Issues.
- Fork this repository
npm install- Create your feature branch:
git checkout -b my-new-feature - Make changes and add tests
npm run test:watchand check your changes by pressingF5- Commit your changes:
git commit -am 'feat: Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request
This fork is licensed under the GNU Affero General Public License v3.0 or later.
The upstream code by Mai Hou was originally distributed under the MIT License. Its original copyright and permission notice are preserved in LICENSE-base.
See changelog here.





