markdown-to-pdf

Installation
SKILL.md

Markdown to PDF (yzane Markdown-PDF parity)

Render Markdown to PDF from the CLI with output matching the VS Code Markdown-PDF extension (yzane, v2.1.0). It reproduces the extension's full pipeline: markdown-it (same options and plugins) → HTML with the extension's own CSS → printed by the user's Google Chrome via puppeteer-core, using the extension's default page options. It additionally renders Mermaid diagrams and embeds images/charts referenced relative to the Markdown file, so documents with flowcharts and embedded chart SVGs come out complete.

Prefer this over pandoc (LaTeX look) or md-to-pdf (different parser and baked-in CSS): only this reproduces the extension's exact styling.

Setup

Nothing to run first: the initial invocation installs the skill's npm dependencies automatically (a one-off, into the skill's own node_modules). To pre-warm it you can run npm install in the skill folder, but it is not required.

Requirements: Node.js and Google Chrome (or Chromium/Edge). Chrome is auto-detected; on macOS it defaults to /Applications/Google Chrome.app/Contents/MacOS/Google Chrome. puppeteer-core drives the existing browser, so nothing is downloaded.

Do not install this inside a cloud-synced folder (OneDrive, Dropbox): node_modules is thousands of files and will cause a sync storm. Keep the skill in a normal git repo and point it at the Markdown files wherever they live.

Usage

Run the script with a file, several files, or a folder:

Installs
3
First Seen
Jul 24, 2026
markdown-to-pdf — onsen-ai/markdown-pdf-skill