From claude-skills
Convert Markdown files to clean A4 PDFs for sharing. Supports Mermaid diagrams via pre-render (mmdc) + SVG inline step.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-skills:md-to-pdfThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Goal: take a `.md` file from a repo and produce a good-looking PDF.
Goal: take a .md file from a repo and produce a good-looking PDF.
<SKILL_DIR> = ${CLAUDE_PLUGIN_ROOT}/skills/md-to-pdf
md-to-pdf (npm global)mmdc (@mermaid-js/mermaid-cli)<SKILL_DIR>/scripts/inline-svg.py<SKILL_DIR>/assets/pdf-style.css<SKILL_DIR>/assets/mermaid-config.json<SKILL_DIR>/scripts/validate-md.shUse validator only for untrusted/external markdown. For trusted repo docs, skip this step.
bash <SKILL_DIR>/scripts/validate-md.sh <input.md>
If the file has Mermaid blocks, run:
WORKDIR=$(mktemp -d)
cp <input.md> "$WORKDIR/input.md"
# 1) Mermaid blocks -> SVG files + processed markdown
mmdc -i "$WORKDIR/input.md" -o "$WORKDIR/processed.md" -e svg \
-c <SKILL_DIR>/assets/mermaid-config.json
# 2) Inline SVG into markdown (required for reliable PDF render)
python3 <SKILL_DIR>/scripts/inline-svg.py "$WORKDIR/processed.md" "$WORKDIR/final.md"
# Use $WORKDIR/final.md in Step 3
If there are no Mermaid blocks, use the original <input.md> in Step 3.
md-to-pdf <source.md> \
--stylesheet <SKILL_DIR>/assets/pdf-style.css \
--highlight-style github \
--pdf-options '{"format":"A4","margin":"25mm 20mm","printBackground":true}'
Quick sanity check:
PDF="<source.pdf>"
[[ -f "$PDF" ]] && [[ $(wc -c < "$PDF") -gt 1000 ]]
Then send PDF via message tool.
md-to-pdf <input.md> \
--stylesheet <SKILL_DIR>/assets/pdf-style.css \
--highlight-style github \
--pdf-options '{"format":"A4","margin":"25mm 20mm","printBackground":true}'
WORKDIR=$(mktemp -d)
cp <input.md> "$WORKDIR/input.md"
mmdc -i "$WORKDIR/input.md" -o "$WORKDIR/processed.md" -e svg \
-c <SKILL_DIR>/assets/mermaid-config.json
python3 <SKILL_DIR>/scripts/inline-svg.py "$WORKDIR/processed.md" "$WORKDIR/final.md"
md-to-pdf "$WORKDIR/final.md" \
--stylesheet <SKILL_DIR>/assets/pdf-style.css \
--highlight-style github \
--pdf-options '{"format":"A4","margin":"25mm 20mm","printBackground":true}'
```mermaid), never ASCII-art boxes.<div class="page-break"></div>
npx claudepluginhub fitz123/claude-skills --plugin claude-skillsConverts Markdown files with Mermaid diagrams to styled PDFs using Python script and Puppeteer. Useful for generating PDF documentation, reports, or printable documents with custom styles.
Converts Markdown to professionally styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and syntax-highlighted code blocks.
Converts Markdown files to professional PDFs using reportlab (lightweight) or weasyprint (full CSS). Manages dependencies, custom styles, test mode, and auto-activates on pdf or md-to-pdf triggers.