agentsclimarketplace

Mkdocs to docx

Skill TUE-AIE/tue-skills/skills/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

Install
npx -y skills add TUE-AIE/tue-skills --skill mkdocs-to-docx

Assembled 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 pandoc
  • mmdc (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 in build/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

  1. Parses mkdocs.yml to get chapter order, site name, description, copyright.
  2. 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.
  3. Concatenates a cover page + chapters into build/docx/combined.md.
  4. Calls pandoc with --reference-doc=templates/tue-template.docx and --toc.
  5. Post-processes the .docx to 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 .mmd in build/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=true in settings.xml, but some Word versions ignore it.

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.