Add Markdown PDF extension#6223
Open
0xPatryk wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Markdown PDF, an extension that exports Markdown files to styled PDFs from inside Zed.
markdown-pdfextension.tomlat the pinned commit)What it does
Adds an Export Markdown to PDF code action (
cmd-.) on Markdown buffers that writes<filename>.pdfnext to the source file. Supports syntax highlighting, KaTeX math, Mermaid diagrams, task lists, footnotes, tables, custom CSS, page size, and margins.How it works
Because the extension runs in the
wasm32-wasip2sandbox and can't spawn a browser, the WASM coordinator launches a native Node.js LSP sidecar (downloaded from this repo's GitHub Releases, per the documentedlatest_github_release+download_filepattern). The sidecar renders Markdown → HTML (markdown-it) and prints with headless Chromium (puppeteer-core), preferring a locally installed Chrome/Edge/Brave and falling back to a lazychrome-headless-shelldownload. Requires Node.js 18+ on PATH.extensions.tomland.gitmoduleswere sorted withpnpm sort-extensions.