md2pdf.py:
- Expose --footer and --header (was dead code before)
- Remove --forms flag (B2 fix — weasyprint 68.1 silently drops <input>)
- Substitution support: {page} → counter(page), {pages} → counter(pages)
- Center-aligned via @bottom-center / @top-center
md2doc.py:
- Add --footer and --header support via Word field codes (PAGE, NUMPAGES)
- Center-aligned paragraph in footer/header
- Same {page}/{pages} substitution API as md2pdf
Both tools:
- GFM task list support: - [ ] → ☐, - [x]/- [X] → ☑ (synced _bulletize)
- Help text explains placeholder syntax with examples
Re-audit found regression: Task 5 Step 3 registered 5 levels but test asserted
[0,1,2] in the abstractNum. Test was BEHAVIORAL (correctly failed on no-op
mutation) but also failed on clean code. Aligning to levels=3 (consistent
with Task 3, more realistic for typical markdown nesting).
Empirical audit (Stage 2) found 2 critical spy tests guarding the H3 keystone:
- test_register_multilevel_numbering_creates_abstractNum_with_3_levels
- test_nested_bullet_list_uses_increasing_ilvl
Both passed when register_multilevel_numbering was mutated to 'return 1'
(no XML written). Rewrote both to BEHAVIORAL form: trace numId → w:num →
w:abstractNumId → w:abstractNum, assert THAT abstractNum has ilvl=[0,1,2].
Also: _render_pre now drops trailing empty line (text.split('\n') artifact).
Design for new md2doc.py (Markdown to DOCX converter) plus two bug-fixes
for md2pdf.py (--footer dead in CLI, --forms produces no AcroForm).
Spec includes 5 empirical hypotheses (H1-H5) about python-docx capabilities
that must be validated before implementation.
- Removed minimal style (not useful)
- Added mono style with JetBrains Mono font
- Changed default from default to elegant
- Fixed bullet consistency with list-style-type: disc
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use list-style-position: inside so bullets are part of text flow,
not separate positioned elements. Fixes copy/paste issues.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Python script with weasyprint for high-quality PDF output
- Wrapper script for easy execution with bundled venv
- Multiple styles: default, minimal, dark, elegant
- Supports single file or directory conversion
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>