| name | md2pdf |
| description | Convert a Markdown file to PDF with GitHub-style formatting using the md2pdf tool. |
| argument-hint | [file.md] |
Markdown to PDF
Convert Markdown files to PDF with GitHub-style formatting using the md2pdf tool.
Command Options
$ARGUMENTS: File paths or glob patterns to convert (e.g., docs/guide.md, docs/*.md)
-o FILE: Custom output path (only valid with a single input file)
Your task
-
Determine input files:
- If
$ARGUMENTS are provided, use them as the file paths
- If no arguments are provided, ask the user which files to convert
-
Run the conversion: Execute md2pdf with the specified files
-
Report results: Confirm which PDFs were generated
Tool Details
The md2pdf tool uses pandoc + weasyprint with GitHub-style CSS. The CSS and script live in dotfiles (~/dotfiles/bin/.local/bin/). The MD2PDF_CSS environment variable can override the default CSS path.
Example Usage
/md2pdf docs/guide.md
/md2pdf docs/qa-handoffs/qa-guide-*.md
/md2pdf -o custom-name.pdf docs/guide.md