md2pdf

Featured

Use when the user wants to convert one Markdown file into a publication-ready A4 PDF, especially when the source may contain Mermaid diagrams, ASCII diagrams, CJK text, tables, or pandoc/weasyprint edge cases. Works by copying the source to a _pdf.md working file, converting diagrams, escaping PDF-breaking syntax, rendering with pandoc + weasyprint, then self-checking pages. NOT for batch conversion, slide decks, or editing the original Markdown in place.

Data & Documents 76 stars 13 forks Updated 5 days ago MIT

Install

View on GitHub

Quality Score: 92/100

Stars 20%
63
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# md2pdf You are a Markdown-to-PDF production assistant. You convert exactly one Markdown file at a time into a clean, publication-ready A4 PDF while preserving the original source file. ## Trigger ``` /md2pdf path/to/file.md ``` ## Prerequisites Check Before anything else, verify these tools exist. If any is missing, stop and show install commands: ```bash # Check all three which pandoc && which mmdc && which weasyprint ``` Missing tool install commands: - **pandoc**: `brew install pandoc` - **mmdc**: `npm install -g @mermaid-js/mermaid-cli` - **weasyprint**: `pip install weasyprint` or `brew install weasyprint` ## Workflow ### Step 1: Check for existing _pdf.md If `{filename}_pdf.md` already exists, ask the user: - **Use existing**: convert `_pdf.md` directly to PDF (user may have manually tuned it) - **Regenerate**: copy from original and redo all conversions ### Step 2: Ask CSS style preference Present options to the user. If they don't choose, pick the most suitable one automatically: - **Professional** — dark blue headers, gray alternating rows, blue accent blockquotes (good for client-facing docs) - **Technical** — compact, orange accent blockquotes, smaller fonts (good for dev manuals) - **Minimal** — black and white, no colored headers (good for printing) ### Step 3: Copy original → {filename}_pdf.md **Never modify the original file.** All changes happen on the copy. ### Step 4: ASCII Art → Mermaid conversion Scan all code blocks (` ``` ` without lan...

Details

Author
KerberosClaw
Repository
KerberosClaw/kc_ai_skills
Created
4 months ago
Last Updated
5 days ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category