Packs / documents-public
docx
Markdown to Word .docx with the stdlib only (headings, lists, tables, quotes) plus a structural validator.
Install
logicpacks pack use documents-public/docxget_pack documents-public/docxThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
chrome-localweasyprint-localpandoc-local - Checks: 3 in
outcome/checks.yaml - Code:
check_docx.pymd2docx.py - Tools: python3
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
An editable .docx for people who need Word, generated without python-docx, valid enough for Word, Pages and LibreOffice.
Steps
- Write the content as markdown.
python3 code/md2docx.py in.md out.docx --title 'Title'.python3 code/check_docx.py out.docx 'Expected heading'validates parts and XML.- On macOS,
textutil -convert txt out.docxreads it back as a second opinion. - Brand styling: open in Word, apply the client's template (styles keep built-in names Heading1-3, Title, Quote).
Edge cases
- Images are not embedded by this converter; add them in Word or ship a PDF instead.
- Nested lists flatten to one level.
Don'ts
- Don't email .docx with tracked changes from internal reviews; accept/reject first.
- Don't put keys or passwords in documents.