/markdown-to-pdf:markdown-to-pdffrom markdown-to-pdf
Use when converting one or more Markdown files into PDFs. Triggers on "convert to PDF", "make PDF", "export PDF", "markdown to PDF". Generic conversion via WeasyPrint with a neutral default stylesheet; pass `--css` to apply your own branded styling.
Ships in markdown-to-pdf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Convert one or more Markdown files into styled PDFs using WeasyPrint and the Python markdown library. The default styling is neutral; apply your own brand stylesheet via --css.
Run the conversion script via uv run:
uv run "${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 at any path. Its dependencies (markdown, weasyprint) are declared in the inline script metadata at the top of convert.py; uv run reads that block and installs them.
Identify target .md files from the request. If none specified, look in the current directory and ask which to convert.
Run the conversion:
uv run <skill-dir>/scripts/convert.py file1.md file2.md
-o <dir> to place PDFs in a specific output directory.--css <path> to override the default stylesheet, e.g. with a stylesheet from the organisation's branding skill or style guide.*.md are supported.--allow-scheme <scheme> (repeatable) only when the document needs images, stylesheets or fonts over a scheme other than https or data (see below).Report which PDF files were created and where.
The bundled assets/style.css provides:
WeasyPrint loads the images, stylesheets and fonts that the Markdown (including raw HTML in it) and the --css file reference. The script lets it load only https: and data: URLs. Any other scheme (http:, file:, ftp:) stops the conversion with refused to load <url> and exit code 1; no PDF is written. Pass --allow-scheme http or --allow-scheme file only for a document you trust. Relative paths such as  are not resolved, because the HTML has no base URL.
Use the organisation's branding (a stylesheet from a branding skill, a style guide or design tokens the project provides) when one is available; otherwise keep the neutral default.
--css yields a PDF without them — no error, just missing elements. For complete output, build the HTML yourself: wrap the body in the wrapper divs the CSS expects, then call weasyprint directly. Called directly, WeasyPrint loads resources over any scheme, including file: and http:, so use that path only for documents you trust.python-markdown (unlike CommonMark) starts a list only when a blank line precedes it. Intro:\n- item renders as literal - item text, not a <ul> — silently. Always leave a blank line between a lead-in sentence and its list.pymupdf/fitz: page.get_pixmap(dpi=150).save(...)) and inspect it — don't trust ✓ converted ... (N KB) alone.Per file:
✓ converted README.md → README.pdf (12.3 KB)
✓ converted RFC-001.md → RFC-001.pdf (4.7 KB)
| Error | Action |
|---|---|
No .md files matched | List directory contents and ask user |
| WeasyPrint missing | uv run convert.py installs it from the script's inline metadata; if it was started as python3 convert.py, rerun it with uv run |
--css file not found | Surface the missing path; do not fall back silently |
refused to load <url> | The document references a scheme other than https/data. Tell the user which URL; rerun with --allow-scheme <scheme> only if they trust the document |
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
markdown-to-pdf@netresearch-claude-code-marketplace is listed by netresearch/claude-code-marketplace — review the source before installing
npx claudepluginhub netresearch/claude-code-marketplace --plugin markdown-to-pdf