Mkdocs to docx
Convert this project's MkDocs documentation into a single TU/e-branded Word (.docx) file. Use when the user asks to "export to Word", "build a docx", "generate a Word document", "convert mkdocs to Word", or similar. Produces dist/AI-Reference-Architecture.docx with cover page, TOC, all chapters in mkdocs.yml nav order, rendered Mermaid diagrams, styled admonitions, and TU/e brand styling.From its SKILL.md
npx -y skills add TUE-AIE/tue-skills --skill mkdocs-to-docxAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.2 KB, as published. Nobody here has run it
MkDocs → Word (.docx)
Converts the AI Reference Architecture MkDocs site into a single consolidated, TU/e-branded .docx for institutional review and circulation.
When to use
Trigger phrases: "export to Word", "build a docx", "generate a Word document", "convert mkdocs to Word", "export docs to .docx", "make a Word version".
One-time setup
.claude/skills/mkdocs-to-docx/scripts/setup.sh
Creates .claude/skills/mkdocs-to-docx/.venv/, installs Python deps, and checks for pandoc + mmdc. If either is missing, the script prints the install command and exits non-zero.
System prerequisites (the script will tell you if they're missing):
pandoc—brew install pandocmmdc(Mermaid CLI) —npm install -g @mermaid-js/mermaid-cli
Usage
From the repo root:
.claude/skills/mkdocs-to-docx/.venv/bin/python .claude/skills/mkdocs-to-docx/scripts/build_docx.py
Output: dist/AI-Reference-Architecture.docx.
Flags:
--output PATH— override output path.--no-cache— re-render every Mermaid diagram (otherwise cached by content hash inbuild/docx/mermaid/).
Regenerating the reference template
The template templates/tue-template.docx is committed. Regenerate only if styles need updating:
.claude/skills/mkdocs-to-docx/.venv/bin/python .claude/skills/mkdocs-to-docx/scripts/make_template.py
What it does
- Parses
mkdocs.ymlto get chapter order, site name, description, copyright. - For each chapter:
- Renders Mermaid fences to PNG via
mmdc(cached by sha256). - Translates pymdownx admonitions (
!!! note "Title") → pandoc fenced divs (::: {.admonition .note}). - Rewrites custom HTML (
<div class="domain-card">,<span class="req-legal">) to pandoc-friendly equivalents that pick up template character/paragraph styles. - Rewrites cross-file links (
02-x.md#anchor) to in-doc anchors. - Demotes headings by one level so each chapter starts at H2.
- Renders Mermaid fences to PNG via
- Concatenates a cover page + chapters into
build/docx/combined.md. - Calls
pandocwith--reference-doc=templates/tue-template.docxand--toc. - Post-processes the
.docxto force TOC field update on first open.
Troubleshooting
- "mmdc not found" — install
npm install -g @mermaid-js/mermaid-cli(requires Node). - Mermaid block fails to render — the script keeps a copy of the offending
.mmdinbuild/docx/mermaid/failed/and prints the path. Fix the source markdown. - Admonition body missing — pymdownx requires the body indented by 4 spaces under
!!! note. The script will warn for an empty body and skip the callout wrapper. - TOC empty on open — in Word: right-click TOC → Update Field. The post-processor sets
updateFields=trueinsettings.xml, but some Word versions ignore it.