markdown-to-pdf
Installation
SKILL.md
Markdown to PDF
Convert one or more Markdown files into styled PDFs using WeasyPrint and the Python markdown library. The default styling is intentionally neutral — apply your own brand stylesheet via --css.
How to use
Run the conversion script via uv run:
uv run --with markdown --with weasyprint python3 "${SKILL_DIR}/scripts/convert.py" <files...> [-o output_dir] [--css custom.css]
${SKILL_DIR} is the directory containing this SKILL.md. The script resolves assets/style.css relative to its own location, so it works regardless of install path.
Steps
- Identify target
.mdfiles from the user's request. If none specified, look for.mdfiles in the current directory and ask which to convert. - Run the conversion: