md-to-pdf

Convert Markdown documents to PDFs with Puppeteer and marked.

Updated Mar 22, 2025
One-click install
npx skills add https://github.com/fcircle-biz/tech_docs --skill md-to-pdf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: md-to-pdf
Source: https://github.com/fcircle-biz/tech_docs/tree/main/.claude/skills/md-to-pdf
Command: npx skills add https://github.com/fcircle-biz/tech_docs --skill md-to-pdf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires puppeteer, marked, and includes scripts (resource) components.

What problem does it solve?

This skill converts Markdown documents into high-quality PDFs using Puppeteer, enabling publication-ready reports and guides with diagrams, code highlighting, and font support.

Core Features & Use Cases

  • Mermaid diagram rendering: Generate ER, flow, sequence, class and other diagrams directly in PDF.
  • Syntax-highlighted code blocks: Preserve code readability with syntax coloring.
  • Japanese typography: Uses Noto Sans JP for clean Japanese text rendering.
  • Deterministic output: Ensures consistent pagination and layout for technical documents.

Quick Start

Run node scripts/md-to-pdf.mjs <markdown-file> to convert a Markdown document to PDF. The output PDF will be created in the same directory with the same base name.

Frequently Asked Questions about md-to-pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to PDF with Mermaid diagrams and syntax highlighting?

To convert Markdown to PDF with Mermaid diagrams and syntax highlighting, run the provided Node.js script, which uses Puppeteer and marked to render publication-ready documents directly from your source files.

Can I render Japanese typography correctly when converting Markdown to PDF?

Yes, you can render Japanese typography in your converted PDF by utilizing built-in Noto Sans JP font support, ensuring clean and accurate Japanese text rendering for technical guides and design documents.

Does Puppeteer provide deterministic pagination and layout control for Markdown to PDF conversion?

Yes, using Puppeteer for Markdown to PDF conversion provides deterministic pagination and layout control, ensuring consistent output for technical documents across different runs and environments.

What is the best way to generate publication-ready PDFs from Markdown for technical guides?

The best way to generate publication-ready PDFs from Markdown is using a Puppeteer-driven script that supports syntax-highlighted code blocks, Mermaid diagrams, and consistent pagination for technical design docs.

Do I need Puppeteer and marked installed to convert Markdown to PDF?

Yes, you need Puppeteer and marked installed as dependencies to execute the Markdown to PDF conversion script, which leverages them for browser-based rendering and Markdown parsing.