md-to-pdf
Skill8 starsChanged 9 months agoMITView on GitHub
Converts markdown files into professionally styled PDF documents. Use this
- Installs packages
20 other projects use a version of this.
Adopted by
Most recently taken up by
- WGlynn/JARVIStheir own version, first seen Nov 16, 2026
- hasan-jilani/claude-skillstheir own version, first seen Nov 16, 2026
- cuitao2046/skillstheir own version, first seen Nov 15, 2026
- StevenZhao666/hermes-kitstheir own version, first seen Nov 8, 2026
- Mathews-Tom/armorytheir own version, first seen Nov 1, 2026
- sanoakr/ai-skillstheir own version, first seen Oct 20, 2026
Other versions20 projects use a version of this.
Word for word · 1
- madebyecho/agent-skills★ 8100% same
Edited · 0
None found.
Wrote their own version · 19
- Mathews-Tom/armory★ 340same name
- huangserva/servasyy_skills★ 168same name
- hamzafarooq/claude-code-starter★ 145same name
- allenyan513/open-investor-skills★ 5same name
- TbusOS/sky-skills★ 3same name
- StevenZhao666/hermes-kits★ 2same name
- WGlynn/JARVIS★ 2same name
- cuitao2046/skills★ 1same name
- luochang212/skills★ 1same name
- sanoakr/ai-skills★ 1same name
9 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/react-native-accessibility/AGENTS.mdAGENTS.md
- skills/swift-accessibility/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- md-to-pdfSkill
- skill-creatorSkill
- react-native-accessibilitySkill
- react-native-animationsSkill
- react-native-skia-shadersSkill
- swift-accessibilitySkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 71
When --status-colors is passed, the script identifies table cells in the Status column that contain bold keywords and applies background …
- Very specific: line 132
Status colors not appearing: Make sure you passed --status-colors.
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Markdown to PDF
Convert any markdown file into a clean, professionally styled PDF. Handles tables, code blocks, blockquotes, and deep heading hierarchies out of the box. Optionally color-codes table cells based on status keywords.
When to Apply
Reference these guidelines when:
- The user asks to convert a markdown file to PDF
- The user wants a printable or shareable version of a document
- The user asks to "export", "generate PDF", or "make a PDF"
- The user wants styled tables with color-coded status cells
- The user needs landscape orientation for wide tables
How It Works
This skill bundles a Python script (scripts/md_to_pdf.py) that handles the full conversion pipeline:
Markdown → HTML (via markdown2) → Styled HTML → PDF (via weasyprint or xhtml2pdf)Always run the bundled script rather than writing conversion code inline. This ensures consistent styling and avoids reinventing the wheel each time.
Quick Start
Basic conversion — the script auto-detects the best orientation:
python3 <skill-path>/scripts/md_to_pdf.py input.md output.pdfWith status cell coloring (colors the table cells, not the text):
python3 <skill-path>/scripts/md_to_pdf.py input.md output.pdf --status-colorsForce landscape or portrait:
python3 <skill-path>/scripts/md_to_pdf.py input.md output.pdf --landscape
python3 <skill-path>/scripts/md_to_pdf.py input.md output.pdf --portraitCustom status keywords and colors:
python3 <skill-path>/scripts/md_to_pdf.py input.md output.pdf --status-colors \
--custom-colors '{"APPROVED": "#d4edda:#155724", "REJECTED": "#f8d7da:#721c24"}'Features
Auto Orientation
The script scans for tables in the markdown. If any table has 4 or more columns, it defaults to landscape. Otherwise, portrait. The user can always override with --landscape or --portrait.
Status Cell Coloring
When --status-colors is passed, the script identifies table cells in the Status column that contain bold keywords and applies background colors to the entire cell. This is column-aware — it only targets cells in columns named "Status", not every bold word in the document.
Built-in keyword → color mappings:
| Keyword | Background | Text Color | Use Case |
| EXISTS | #d4edda (green) | #155724 | Available, implemented |
| MISSING | #f8d7da (red) | #721c24 | Not available, needed |
| PARTIAL | #fff3cd (yellow) | #856404 | Partially available |
| TODO | #fff3cd (yellow) | #856404 | Pending work |
| DONE | #d4edda (green) | #155724 | Completed |
| CLIENT-SIDE | #d1ecf1 (blue) | #0c5460 | Handled by client |
| NEEDS CLARIFICATION | #e8daef (purple) | #512e5f | Requires discussion |
| WARNING | #fff3cd (yellow) | #856404 | Caution |
| ERROR | #f8d7da (red) | #721c24 | Failure |
| N/A | #e2e3e5 (gray) | #495057 | Not applicable |
Users can add or override mappings with --custom-colors.
Engine Fallback
The script tries weasyprint first (better CSS support, proper page breaks, modern rendering). If weasyprint is not installed, it falls back to xhtml2pdf (pure Python, always installable). If neither is available, the script prints install instructions and exits — it does not auto-install packages.
Before first use, install dependencies explicitly:
pip install markdown2==2.5.3
pip install weasyprint # recommended
# OR
pip install xhtml2pdf==0.2.16 # pure Python fallbackPage Breaks
Each ## (h2) heading starts on a new page for long documents. This keeps sections cleanly separated in the PDF output.
Default Styling
The generated PDF includes sensible defaults:
- Font: Helvetica / Arial sans-serif, 9px body
- Headings: Scaled sizes (h1: 20px → h4: 10px), h1/h2 with bottom borders
- Tables: Collapsed borders, dark header row (
#2c3e50background, white text), alternating row colors - Code blocks: Light gray background, monospace font
- Blockquotes: Left blue border, light background
- Page margins: 1.5cm on all sides
Arguments Reference
| Argument | Required | Default | Description |
input | Yes | — | Path to the markdown file |
output | No | <input>.pdf | Output PDF path. Defaults to same name with .pdf extension |
--landscape | No | Auto | Force landscape orientation |
--portrait | No | Auto | Force portrait orientation |
--status-colors | No | Off | Enable status keyword cell coloring |
--custom-colors | No | — | JSON string of custom keyword → color mappings. Format: '{"KEYWORD": "#bg:#text"}' |
Troubleshooting
Tables look clipped or overflow: Try --landscape to give tables more horizontal space.
Status colors not appearing: Make sure you passed --status-colors. The feature is off by default. Also verify that the status keywords are wrapped in **bold** in the markdown source.
weasyprint won't install: It requires system libraries (cairo, pango). On macOS: brew install cairo pango. On Ubuntu: apt install libcairo2-dev libpango1.0-dev. If you can't install them, the script falls back to xhtml2pdf automatically.
Fonts look different: weasyprint uses system fonts, xhtml2pdf uses built-in PDF fonts. Results may vary slightly between engines.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

