The Fold — Markdown to PDF
A desktop VS Code extension that renders the current Markdown file to a
vector-first PDF using the bundled Rust the-fold renderer.
What it does
- Adds a fold pdf command, an editor-title button, and an explorer
context-menu entry (all gated to
.md files).
- Saves the Markdown document first (if dirty), then shells out to the bundled
platform-specific
the-fold binary with the extension folder as its working
directory so the bundled assets/ fonts resolve at runtime.
- Zero options. The Markdown file is folded into a PDF beside the source:
<source-dir>/<source-stem>.pdf. There is no save dialog and no path prompt.
- After a successful render, offers Open PDF and Reveal in File Manager.
- Adds a The Fold: Show Runtime Info command for diagnostics.
Usage
- Open or select a
.md file.
- Run fold pdf from the command palette, the editor-title button, or the
explorer right-click menu.
- The PDF is written beside the Markdown source. Choose Open PDF or
Reveal in File Manager from the completion notification.
Configuration
theFold.binaryPath (string, default ""): absolute path override for the
the-fold binary. Leave empty to use the bundled platform binary.
Supported runtime targets
darwin-arm64
win32-x64
win32-arm64
linux-x64
linux-arm64
Linux support is runtime-gated to distro IDs ubuntu and arch read from
/etc/os-release. The extension does not support remote extension hosts.
Binary layout
The compiled renderer must live at bin/<target>/the-fold[.exe] before
packaging:
bin/darwin-arm64/the-fold
bin/win32-x64/the-fold.exe
bin/win32-arm64/the-fold.exe
bin/linux-x64/the-fold
bin/linux-arm64/the-fold
The assets/ folder must contain the *.ttf fonts the renderer loads at
runtime.
Build & stage
Stage a binary built elsewhere (no Cargo build):
cd vscode-extension
node ./scripts/stage-binary.js --target win32-x64 --binary ../target/release/the-fold.exe
Build and stage with Cargo:
cd vscode-extension
node ./scripts/stage-binary.js --target darwin-arm64 --build
node ./scripts/stage-binary.js --target win32-x64 --build
node ./scripts/stage-binary.js --target win32-arm64 --build
node ./scripts/stage-binary.js --target linux-x64 --build
node ./scripts/stage-binary.js --target linux-arm64 --build
Convenience npm scripts mirror the staging targets:
cd vscode-extension
npm run stage:darwin-arm64
npm run stage:win32-x64
npm run stage:win32-arm64
npm run stage:linux-x64
npm run stage:linux-arm64
Packaging
Package one platform-specific VSIX per target so VS Code selects the correct
binary package for the host. Do not publish an untargeted fallback VSIX for this
extension; the renderer is native.
cd vscode-extension
npx --yes @vscode/vsce package --target darwin-arm64 --ignore-other-target-folders
npx --yes @vscode/vsce package --target win32-x64 --ignore-other-target-folders
npx --yes @vscode/vsce package --target win32-arm64 --ignore-other-target-folders
npx --yes @vscode/vsce package --target linux-x64 --ignore-other-target-folders
npx --yes @vscode/vsce package --target linux-arm64 --ignore-other-target-folders
For Marketplace release requirements and the multi-machine publishing plan, see
RELEASE.md.