markdown-to-pdf
Skill0 starsChanged 55 days agoMITView on GitHub
Convert markdown files to beautifully formatted PDFs with dark mode support. This skill should be used when users want to export markdown documents to PDF format, especially when they need dark themes, proper ASCII diagram rendering, or professional formatting for tables with icons.
- Installs packages
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 56
Add --print-to to send the PDF directly to a printer after conversion:
- Distinctive: line 141
Ensure Noto Color Emoji or similar emoji font is installed:
“Common” is measured: kept by at least 6 in 10 of the 8 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 Skill
Convert markdown documents to high-quality PDFs with dark mode support, proper ASCII diagram rendering, and professional table formatting.
Features
- Dark mode theme (default) with Catppuccin Mocha colors
- Light mode theme with Catppuccin Latte colors
- Print mode theme - printer-friendly black & white, high contrast
- ASCII diagram support with proper monospace font alignment
- Unicode icon support (checkmarks, emojis, etc.)
- Professional table formatting with alternating row colors
- Code block syntax highlighting optimized for readability
Usage
Basic Conversion (Dark Mode)
python ~/.claude/skills/markdown-to-pdf/scripts/md2pdf.py document.mdSpecify Output File
python ~/.claude/skills/markdown-to-pdf/scripts/md2pdf.py document.md -o output.pdfLight Mode
python ~/.claude/skills/markdown-to-pdf/scripts/md2pdf.py document.md --lightPrint Mode (Black & White)
python ~/.claude/skills/markdown-to-pdf/scripts/md2pdf.py document.md --printBest for physical printing - uses only black, white, and grays for maximum legibility and toner efficiency.
Custom CSS
python ~/.claude/skills/markdown-to-pdf/scripts/md2pdf.py document.md --css custom.cssSend to Printer
Add --print-to to send the PDF directly to a printer after conversion:
python ~/.claude/skills/markdown-to-pdf/scripts/md2pdf.py document.md --print --print-to brotherThis converts to PDF (using print-friendly theme) and sends it straight to the printer via lp. The --print-to flag takes a CUPS printer name.
Printing an existing PDF (no conversion needed):
lp -d brother document.pdfAvailable Printers
The system has CUPS configured with:
- brother — Brother printer (default)
To check printer status: lpstat -p
Output
The script outputs file:// URLs for the created PDFs. Always include these URLs in your response to the user so they can easily open the files in their browser or PDF viewer.
Requirements
The following packages must be installed:
# Arch Linux
sudo pacman -S pandoc python-weasyprint
# Ubuntu/Debian
sudo apt install pandoc weasyprint
# macOS
brew install pandoc
pip install weasyprintBundled Assets
assets/dark-mode.css- Catppuccin Mocha dark themeassets/light-mode.css- Catppuccin Latte light themeassets/print-mode.css- Printer-friendly black & white theme
Technical Notes
ASCII Diagram Rendering
The CSS is optimized for ASCII art with:
- DejaVu Sans Mono as the primary monospace font
- Zero letter-spacing to ensure box characters align
- Proper line-height (1.3) for connected box drawings
white-space: preto preserve exact spacing
Color Printing
The stylesheets include print-color-adjust: exact to ensure background colors render correctly when printing to PDF.
Page Breaks
To force a page break, use:
<div class="page-break"></div>Troubleshooting
Missing fonts
Install DejaVu fonts for best ASCII diagram rendering:
# Arch Linux
sudo pacman -S ttf-dejavu
# Ubuntu/Debian
sudo apt install fonts-dejavuIcons not rendering
Ensure Noto Color Emoji or similar emoji font is installed:
# Arch Linux
sudo pacman -S noto-fonts-emojiOther versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- staskh/trading_skills★ 399same name
- black-yt/skills★ 16same name
- guishiw/Guishi-Skills★ 8same name
- leotrinh/ai-agent-skills★ 3same name
- quickcall-dev/skills★ 2same name
- bendyworks/claude-skills★ 1same name
- dzivkovi/claude-skills★ 1same name
- THEROCKSSS/hermes-skills-portfolio★ 1same name
- ong6/skills★ 0same name
- rahulrajaram/rahulskills★ 0same name
1 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 repository43 other files it gives its agents.
- skills/technical/supabase-postgres-best-practices/AGENTS.mdAGENTS.md
- skills/technical/supabase-postgres-best-practices/CLAUDE.mdCLAUDE.md
- direct-handoffSkill
- handoffSkill
- nt-commsSkill
- threadsSkill
- meal-planningSkill
- resume-workflowSkill
- bash-scriptsSkill
- code-reviewSkill
- davinci-resolveSkill
- disk-cleanupSkill
- fastmcp-pythonSkill
- go-cliSkill
- pr-createSkill
- qa-planSkill
- rcaSkill
- react-native-best-practicesSkill
- ruby-railsSkill
- skill-creatorSkill
- spec-checkSkill
- supabase-migrationsSkill
- supabase-postgres-best-practicesSkill
- supabase-sqlSkill
- testingSkill
- ui-state-managementSkill
- waydroid-adbSkill
- calcinatioSkill
- citationsSkill
- exploreSkill
- manual-qaSkill
- nvim-copilotSkill
- orchestrateSkill
- orthogonal-emanationSkill
- product-intent-signal-extractionSkill
- project-management-signal-extractionSkill
- request-researchSkill
- researchSkill
- skill-discoverySkill
- slack-thread-triageSkill
- specSkill
- tmux-sidecarSkill
- youtube-transcribeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

