md-to-docx
SKILL.md
Markdown to Word (.docx) Converter
Convert Markdown files to professionally formatted Word documents, with automatic template style extraction and Mermaid diagram rendering.
How It Works
The bundled script (scripts/md_to_docx.py) handles the entire conversion:
- Parse Markdown into structured blocks (headings, body, lists, tables, code, quotes)
- Extract styles from an optional Word template (.doc or .docx) — font, size, alignment, spacing
- Apply formatting to each block, preserving inline Markdown (bold, italic, code, strikethrough)
- Render Mermaid diagrams to PNG via
mmdc(mermaid-cli) and embed them as images - Output a ready-to-use .docx file
Dependencies
The script requires:
- python-docx:
pip install python-docx