Skip to content

Packs / documents-public

docx

Markdown to Word .docx with the stdlib only (headings, lists, tables, quotes) plus a structural validator.

L2 Checks passed 3 of 3 runsv1.0.0Tech-Realm/space-documents-public

Install

logicpacks pack use documents-public/docx
get_pack documents-public/docx

The 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

  1. Write the content as markdown.
  2. python3 code/md2docx.py in.md out.docx --title 'Title'.
  3. python3 code/check_docx.py out.docx 'Expected heading' validates parts and XML.
  4. On macOS, textutil -convert txt out.docx reads it back as a second opinion.
  5. 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.