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, balancing table column widths, rendering with pandoc + weasyprint, then self-checking pages by ink coverage. Cleans up intermediates only after the user calls the version final. NOT for batch conversion, slide decks, or editing the original Markdown in place.

Data & Documents 79 stars 14 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
63
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
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 style, and ask about a table of contents **2a. CSS style.** Present options; if the user doesn'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) **2b. Table of contents — always ask, never assume.** A contents page also pulls the title onto a cover sheet, so switching it on costs a full page before the reader re...

Details

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

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category