agentleFS
enkr1enkr1/claude-code-skills/skills/md2pdf/SKILL.md

md2pdf

Skill1 starsChanged 5 months agoMITView on GitHub

Convert a Markdown file into a clean, print-ready PDF. Use whenever the user wants to turn a .md into a .pdf — submissions, tutorials, helpsheets, reports, notes, any markdown → PDF. Triggers on "md to pdf", "convert to pdf", "make/export a pdf", "print this markdown", or naming a .md and asking for a .pdf. Bundles a cross-browser pandoc + headless-Chromium pipeline that needs no LaTeX.

  • Installs packages

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. kaiye/skills★ 19same name
    2. developer0hye/marknest★ 15same name
    3. tanpenggood/skills★ 1same name
    4. cy070812/md2pdf-skill★ 0same name
    5. Qubity-dev/claude-skills★ 0same name

    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 repository8 other files it gives its agents.

The file

Files
SKILL.md

md2pdf — Markdown → print-ready PDF

Run the bundled script. Do NOT hand-type a pandoc/Chrome command each time.

"$HOME/.claude/skills/md2pdf/scripts/md2pdf.sh" <input.md> [output.pdf]

(If invoked as a plugin, the same script is at "${CLAUDE_PLUGIN_ROOT}/skills/md2pdf/scripts/md2pdf.sh".)

Usage

md2pdf.sh <input.md>                 # → <input>.pdf in the same folder
md2pdf.sh <input.md> <output.pdf>    # explicit output name (single file)
md2pdf.sh a.md b.md c.md             # batch: each → its own .pdf

What it does for you

  • Engine: pandoc → self-contained HTML (embeds the stylesheet) → headless Chromium --print-to-pdf (Producer: Skia/PDF). Chosen because no LaTeX engine is needed and Chromium gives nicer output than wkhtmltopdf with zero installs.
  • Checks: warns on em dashes (—) and reports the page count, warning if it goes over 2 pages (handy for capped submissions).

Customising

  • Style: edit scripts/md2pdf.css to restyle every PDF. One-off override: MD2PDF_CSS=/path/to/other.css md2pdf.sh file.md.
  • Browser: auto-detected (Chrome / Chromium / Brave / Edge / Canary, .app or on PATH). Force one with CHROME_BIN=/path/to/browser.

Requirements

  • pandoc (brew install pandoc)
  • A Chromium-family browser (Chrome / Chromium / Brave / Edge)
  • Optional: pdfinfo (poppler) for page counts; falls back to a pure-Python count.

Typical flow (a graded submission)

  1. Draft answers in the user's own voice (not polished AI prose).
  2. Strip em dashes (the script warns if any remain).
  3. md2pdf.sh answers.md submission.pdf
  4. Confirm it is within the page cap, then the user uploads it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.