md-to-doc
Skill0 starsChanged 22 days agoMITView on GitHub
Convert Markdown files into clean Word (.docx) or PDF documents with tables, code blocks, headings and a table of contents intact, using pandoc plus a fallback chain for PDF engines. Use this whenever someone wants to turn a .md / README / notes / report into a Word doc or PDF, "export this markdown", "make this a docx", "send this as a PDF", batch-convert a folder of markdown, or complains that tables broke when converting — even if they don't mention pandoc.
- Installs packages
2 other projects use a version of this.
Adopted by
Most recently taken up by
- vladimiracunadev-create/claude-skills-toolkittheir own version, first seen Nov 1, 2026
- vladimiracunadev-create/codex-skills-toolkittheir own version, first seen Sep 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- vladimiracunadev-create/claude-skills-toolkit★ 1same name
- vladimiracunadev-create/codex-skills-toolkit★ 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 repository7 other files it gives its agents.
- anti-slop-editorSkill
- codebase-viva-prepSkill
- incident-postmortemSkill
- oss-readySkill
- pr-explainer-quizSkill
- stacked-pr-splitterSkill
- terraform-plan-reviewerSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
If none exist, produce the .docx, and tell the user the one-line install that would unlock PDF (brew install typst on macOS is the …
- Distinctive: line 42
Before converting, skim the Markdown for these and fix them in a temp copy (don't edit the user's source unless asked):
- Very specific: line 53
Use save as … file format format PDF (not save as2).
- Distinctive: line 58
Don't try to install heavy system libraries (pango/gobject for weasyprint, full TeX Live) without asking — it can take 10+ minutes.
- Very specific: line 59
Don't overwrite an existing output file silently.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Markdown → Word / PDF
Turn Markdown into a document someone can open, print, or attach — without mangled tables.
Why this skill exists
Pandoc handles .md → .docx well with zero extra dependencies. PDF is where people get stuck: pandoc needs a PDF engine (LaTeX, weasyprint, wkhtmltopdf, typst…) and most machines have none. Guessing wastes minutes and produces cryptic errors. So: detect what's installed first, then pick the path that will actually work.
Workflow
- Locate input(s) and decide output format. If the user said "doc"/"Word" →
.docx. "PDF" →.pdf. Unsure →.docx(it always works) and mention PDF is available. - Run the bundled script — it does detection and fallbacks for you:
Addbash <skill-dir>/scripts/md2doc.sh input.md output.docx bash <skill-dir>/scripts/md2doc.sh input.md output.pdf bash <skill-dir>/scripts/md2doc.sh notes/ out/ pdf # whole folder--tocto include a table of contents (good for anything with 3+ headings). Word output uses the bundledassets/reference.docxby default: pandoc's own styles plus visible table borders and a shaded header row. Pandoc's stock tables have no borders, and in Word that looks like loose text, which is usually what people mean when they say tables "came out as garbage". Pass--reference-doc corp.docxfor a company template, or--no-stylefor pandoc's plain default. - Check before reporting. Convert the docx back (
pandoc out.docx -t gfm | head -40) and confirm the tables have the right rows and columns. For a PDF, check the page count (mdls -name kMDItemNumberOfPageson macOS, orpdfinfo). - Report the absolute output path and which engine was used. If the script fell back (e.g. to a headless browser or Word), say so in one line.
PDF engine order (what the script tries)
| Order | Engine | Notes |
| 1 | typst | Fast, single binary, good tables. brew install typst |
| 2 | xelatex / lualatex / pdflatex | Best typography; handles Unicode best with xelatex |
| 3 | weasyprint / wkhtmltopdf | HTML-based; CSS-styleable |
| 4 | Headless Chrome / Edge / Chromium / Brave | Already on most machines. pandoc → HTML with assets/print.css (bordered tables) → --print-to-pdf. A few seconds. |
| 5 | docx → PDF via LibreOffice (soffice --headless) | Cross-platform fallback |
| 6 | docx → PDF via Microsoft Word (macOS AppleScript) | Last resort: ~60s cold start |
If none exist, produce the .docx, and tell the user the one-line install that would unlock PDF (brew install typst on macOS is the lightest).
Table hygiene (the most common complaint)
Before converting, skim the Markdown for these and fix them in a temp copy (don't edit the user's source unless asked):
- Pipe tables need a header separator row (
|---|---|) — without it pandoc renders plain text. - A blank line is required before a table that follows a paragraph.
- Very wide tables (6+ columns) overflow PDF pages: suggest landscape (
-V geometry:landscapefor LaTeX) or the docx route. - Literal
|inside a cell must be escaped as\|.
Word-on-macOS gotchas (built into the script, listed in case you script it yourself)
- Word is sandboxed. Opening or saving outside paths it has been granted (e.g.
/tmp) pops a "Grant File Access" dialog and the script hangs. Stage files in~/Library/Containers/com.microsoft.Word/Data/and move the PDF out afterwards. - Address the document as
active document, notdocument "name.docx"— the name form fails with error -1708. - Cold-starting Word can time out (-1712) even though it's opening. Wait until Word answers a trivial Apple Event, then open, wait, and
save asin a separate call; retry with a longer wait. - Use
save as … file format format PDF(notsave as2). Wrap everyosascriptcall in a timeout so a dialog can never hang the session. - Cold start takes ~60s; warm ~15s. Tell the user it's working rather than going silent.
Don't
- Don't try to install heavy system libraries (pango/gobject for weasyprint, full TeX Live) without asking — it can take 10+ minutes. Offer the light option instead.
- Don't overwrite an existing output file silently; if it exists, write
name (1).docxor ask.
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
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.

