Fancy Markdown is a VS Code extension designed to preview and export Markdown documents using custom CSS style sheets. Easily load CSS stylesheets from local directories, workspace paths, remote URLs, or even active unsaved buffers, and export your stylized Markdown to clean HTML or high-fidelity PD
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Fancy Markdown is a VS Code extension designed to preview and export Markdown documents using custom CSS style sheets. Easily load CSS stylesheets from local directories, workspace paths, remote URLs, or even active unsaved buffers, and export your stylized Markdown to clean HTML or high-fidelity PDF documents.
Features
Live CSS Styling: Preview your Markdown dynamically with custom styles.
Flexible CSS Sources: Load stylesheets from local filesystem, internet URLs, workspace files, or in-memory untitled buffers.
Cursor Synchronization: Automatically scroll the webview preview to match your editor cursor position, highlighting the active block.
Portables Export: Save your stylized work to HTML (autocontained inline styles) or PDF format using a local Chromium engine.
Usage Commands
Fancy Markdown: Preview with CSS - Opens the side-by-side webview preview panel.
Fancy Markdown: Select CSS Style Sheet - Configures the style sheet to apply on the active Markdown.
Fancy Markdown: Export to HTML - Generates a standalone HTML document.
Fancy Markdown: Export to PDF - Generates a print-ready PDF document.
Page Breaks
You can add page breaks to your Markdown documents that will be visually displayed in the editor preview and will split pages when exporting to HTML or PDF.
Supported formats:
Comments: Add a special page break comment:
<!--- Page Break --->
(Also accepts case-insensitive variations like <!-- page-break -->, <!-- pagebreak -->, or <!-- Page Break -->).
Custom Divider: Write ---/--- on a line by itself:
---/---
Extension Settings
This extension contributes the following settings:
fancy-markdown.pdf.executablePath: Absolute path to a Chromium-based browser executable (Chrome, Edge, etc.) for PDF exports.
Development
To run the extension locally:
Open the repository in VS Code.
Run pnpm install to load dependencies.
Press F5 to launch the Extension Development Host.