Markdown to File
Turn the Markdown file you're editing into a clean, print-ready document — right inside VS Code. A live, paginated preview shows the exact pages you'll get, and a single command exports to PDF (via the print dialog) or HTML.
This is the markdowntofile.com renderer, brought into your editor. Everything runs 100% locally — nothing you type is ever uploaded.
Features
- Live paginated preview — real A4/Letter/Legal/A3 pages with margins and page numbers, updating as you type.
- Export to PDF — opens the system print dialog; choose Save as PDF for selectable, vector text (not an image).
- Export to HTML — a self-contained, styled
.html file you can share or print anywhere.
- Full Markdown — tables, task lists, fenced code with syntax highlighting, footnotes, KaTeX math (
$…$, $$…$$) and Mermaid diagrams.
- Themes — Auto (follows your editor's light/dark), plus GitHub, Clean, Academic and Dark document styles. The page floats on your real editor background, so the preview feels native.
- Table of contents — optional, generated from your H1–H3 headings.
Usage
- Open a Markdown (
.md) file.
- Run Markdown to File: Open Preview to the Side — from the Command Palette, the editor title bar (the PDF icon), the explorer right-click menu, or
Ctrl/Cmd+Shift+V.
- To export:
- PDF — run Markdown to File: Export to PDF and choose Save as PDF in the print dialog.
- HTML — run Markdown to File: Export to HTML and pick a destination.
Settings
| Setting |
Values |
Default |
markdownToFile.theme |
auto, github, clean, academic, dark |
auto |
markdownToFile.pageSize |
a4, letter, legal, a3 |
a4 |
markdownToFile.margin |
narrow, normal, wide |
normal |
markdownToFile.toc |
true, false |
false |
The preview updates immediately when you change any of these.
Notes
- PDF export uses VS Code's built-in print path, so the page geometry (size, margins, page numbers) is owned by the document's
@page rules — pick Save as PDF and leave the browser/printer scaling at 100%.
- Mermaid and KaTeX render locally; no network access is required for the preview.
License
MIT — see LICENSE.
| |