用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/fabioc-aloha/ai-wallpaper-generator --skill md-to-word命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Defense-in-depth, PII protection, secrets scanning, and secure packaging for distributed software
Systematic testing for confidence without over-testing — the right test at the right level
Generate consistent visual character references across multiple scenarios using Flux and nano-banana-pro on Replicate
基于 SOC 职业分类
正在显示 SKILL.md
| name | md-to-word |
| description | Convert Markdown with Mermaid diagrams to professional Word documents |
| version | 2.0.0 |
One command to professional Word documents with perfect diagram sizing
Convert any Markdown document, including complex Mermaid diagrams, into polished Word (.docx) files ready for stakeholders, executives, and external audiences.
The complete workflow from Markdown to final PDF:
md-to-word.py to generate a .docx with styled tables, centered diagrams, and formatted headingsThis skill handles step 1. Steps 2 and 3 are manual because Word provides superior PDF rendering, font embedding, and layout control compared to automated Markdown-to-PDF pipelines.
| Challenge | Solution |
|---|---|
| Mermaid diagrams don't render in Word | Auto-converted to PNG with optimal sizing |
| Tables lack professional styling | Blue headers, borders, alternating rows |
| Tables break awkwardly across pages | Smart pagination (cantSplit + keepWithNext) |
| Images overflow page boundaries | 90% coverage constraint (H+V) preserves fit |
| Bullet lists merge into paragraphs | Markdown preprocessing fixes spacing |
| SVG banners not supported | Auto-converted to PNG |
# From your project root
python .github/muscles/md-to-word.py docs/spec.md
# With custom output name
python .github/muscles/md-to-word.py README.md output.docx
# Keep intermediate files for debugging
python .github/muscles/md-to-word.py docs/plan.md --keep-temp
| Tool | Install Command | Purpose |
|---|---|---|
| Python 3.10+ | (system) | Script runtime |
| pandoc | winget install pandoc | Markdown to Word |
| mermaid-cli | npm install -g @mermaid-js/mermaid-cli | Mermaid to PNG |
| python-docx | pip install python-docx | Table formatting |
| svgexport | npm install -g svgexport | SVG to PNG (optional) |
winget install pandoc
npm install -g @mermaid-js/mermaid-cli svgexport
pip install python-docx
| Option | Default | Description |
|---|---|---|
--images-dir | images | Directory for generated PNG files |
--no-format-tables | false | Skip table styling (faster) |
--keep-temp | false | Keep temporary markdown file |
The script automatically fits images to 90% of page bounds:
Page: 8.5" x 11" (Letter)
Margins: 1" each side
Usable: 6.5" x 9.0"
Max image: 5.85" x 8.1" (90%)
| Diagram Type | Typical Constraint |
|---|---|
| Gantt (wide) | {width=5.8in} |
| Flowchart TB (tall) | {height=8.1in} |
| Architecture layers | {width=5.8in} |
| Escalation maps | {height=8.1in} |
All tables receive professional styling:
| Element | Style |
|---|---|
| Header row | Microsoft blue (#0078D4), white text, bold |
| Even rows | Light gray (#F0F0F0) |
| Odd rows | White (#FFFFFF) |
| Borders | Gray outer (#666666), light inner (#AAAAAA) |
| Font | 10pt headers, 9pt data |
| Pagination | Rows don't split; headers stay with data |
| Type | Detection | Sizing Strategy |
|---|---|---|
| Gantt | gantt keyword | Width priority |
| Flowchart LR | flowchart lr | Width priority |
| Flowchart TB | flowchart tb | Height priority |
| Sequence | sequenceDiagram | Width priority |
| Class | classDiagram | Auto |
| ER | erDiagram | Auto |
| Pie | pie | Smaller width |
| Issue | Cause | Fix |
|---|---|---|
| "mmdc not found" | mermaid-cli not installed | npm install -g @mermaid-js/mermaid-cli |
| "pandoc not found" | pandoc not in PATH | winget install pandoc, restart terminal |
| Tables not styled | python-docx missing | pip install python-docx |
| Diagrams too large | Old script version | Update to v2.0.0 with 90% H+V |
| Bullet lists merged | Markdown spacing | Script auto-fixes (v2.0.0+) |
python .github/muscles/md-to-word.py doc.md --keep-temp
# Check _temp_word.md for transformed content
.github/muscles/md-to-word.py to your project# Convert entire docs folder
Get-ChildItem docs/*.md | ForEach-Object {
python .github/muscles/md-to-word.py $_.FullName
}
| Version | Changes |
|---|---|
| 2.1.0 | Table pagination (cantSplit, keepWithNext) prevents orphan headers |
| 2.0.0 | 90% H+V coverage, actual PNG dimension reading, markdown preprocessing |
| 1.1.0 | Centered images, heading colors, paragraph spacing |
| 1.0.0 | Initial: pandoc + mermaid + table formatting |