← ClaudeAtlas

markdown-to-docxlisted

Use this skill whenever the user wants to convert a Markdown file to a Word document (.docx). Triggers include: 'convert markdown to Word', 'convert .md to .docx', 'render mermaid to Word', 'generate Word doc from markdown', 'export markdown as docx', or any request to turn a .md file into a .docx. Use this skill even if the user just says 'make a Word doc from this markdown' or 'convert this to Word'. This skill handles: (1) native Word TOC placed after the document header block (H1 title + metadata + '---' separator), (2) Mermaid diagram blocks rendered to high-resolution PNG and embedded as images, and (3) tables formatted with colored header rows, alternating row shading, and borders. Do NOT use for PDFs, Google Docs, spreadsheets, or general DOCX editing unrelated to Markdown conversion.
desmondc9/agent-skills · ★ 0 · Data & Documents · score 72
Install: claude install-skill desmondc9/agent-skills
# Markdown → DOCX Conversion Converts any Markdown file to a professionally formatted Word document (.docx) using a bundled Python pipeline: **pandoc** + **mmdc** (Mermaid CLI) + **python-docx** post-processing. ## What This Skill Does 1. **Pre-processes Markdown** — strips any manually written `## Table of Contents` section, injects TOC placeholder strings after the first `---` separator (i.e., right after the document header block: title + metadata + `---`) 2. **Renders Mermaid diagrams** — finds every ` ```mermaid ` fenced block, renders each to a high-resolution PNG (2400 px wide, 3× scale), and replaces the block with an image reference 3. **Converts with pandoc** — produces the base `.docx` from the processed Markdown 4. **Post-processes the DOCX** — replaces the TOC placeholders with a native Word TOC field (`{ TOC \o "1-3" \h \z \u }`) and applies table formatting (dark header row, alternating row shading, cell borders) ## Usage ```bash python <skill-scripts-path>/convert_markdown_to_docx.py <input.md> [output.docx] ``` - `input.md` — path to the Markdown file (required) - `output.docx` — output path (optional; defaults to `<input>.docx`) **Example:** ```bash python ~/.claude/skills/markdown-to-docx/scripts/convert_markdown_to_docx.py solution.md python ~/.claude/skills/markdown-to-docx/scripts/convert_markdown_to_docx.py docs/report.md docs/report.docx ``` ## How to Run for the User When the user asks to convert a markdown file: 1. Identify the input file p