−281 KiB
(109 KiB)
pdf-tools/.gitignore
0 → 100644
+4
−0
+125
−0
+676
−94
File changed.
Preview size limit exceeded, changes collapsed.
Loading
Re-renders tasking/DANGLE-Motion-Failure-Analysis.pdf from the markdown
source using WeasyPrint with a fully-revised print stylesheet and light
HTML post-processing. The previous PDF (generated by Chromium headless
print) had a filename header, a file:// footer, a run-on metadata
paragraph, no table of contents, and code blocks that were clipped at
the right margin in the appendices. This commit replaces it with a
professional-looking 15-page report suitable for handing to motion
control engineers.
Rendering features added to md2pdf.py:
- Title page with the H1 title and a parsed metadata key/value grid
(pulled from the `**Label:** value` lines that follow the H1).
- Table of contents auto-built from H2 headings, using WeasyPrint's
leader(dotted) and target-counter(attr(href url), page) to produce
dotted leaders and live page numbers. All 13 H2s appear in the TOC,
including the appendices and the bottom-line section (fixed a regex
bug where the earlier version's H2 match required `id="..."` to be
the first attribute, dropping any H2 we'd tagged with a class).
- Running page header (document title on the left, "BL4A -- Motion
Control" on the right) and "Page X of Y" footer. No filename or
file:// URL.
- Executive Summary section wrapped in an amber callout box.
- Bottom line section wrapped in a green callout box, forced onto its
own final page.
- Appendix H2s ("Appendix A:" through "Appendix D:") styled with a
tinted purple band and each forced onto its own page for clean
back-matter separation.
- Recommended Fixes, Open Questions, and Appendix A get CSS
`break-before: page` so they always start on a fresh page.
- Code blocks dropped from 8 pt to 7.25 pt and switched from
`white-space: pre` to `white-space: pre-wrap`, so the long lines in
the substitutions comparison and the Appendix A parameter history
wrap at word boundaries instead of silently clipping past the right
margin. Appendix A's trailing notes and the Appendix D timeline now
render in full.
- DejaVu Sans / DejaVu Sans Mono throughout (already installed on
every Linux machine; no exotic fonts needed).
- Each H2 has `break-after: avoid` to prevent orphaned headings.
- Debug HTML is now opt-in via `MD2PDF_DEBUG=1` so it doesn't clutter
the tasking directory by default.
Auxiliary additions:
- pdf-tools/README.md — quickstart, option reference, the
section-level styling hooks the tool looks for in the source
markdown, and the trade-offs (ASCII-art wrap vs clipping, no
syntax highlighting yet, no section numbering yet, wide-table
landscape as a future option).
- pdf-tools/.gitignore — excludes .venv/, __pycache__/, *.debug.html.
File-size comparison:
- Chromium headless print: 398,830 bytes, 7 pages
- WeasyPrint via md2pdf.py: 111,204 bytes, 15 pages
Co-Authored-By:
Claude Opus 4.6 (1M context) <noreply@anthropic.com>
File changed.
No diff preview for this file type.
File changed.
Preview size limit exceeded, changes collapsed.