mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-20 04:45:11 -05:00
Reframe the post-render script as a designed resolution step of the
website-mode pipeline rather than a "fix" for broken output. Extend it
to handle the previously-unresolved `Principle \ref{pri-X}` pattern:
Pandoc parses bare `\ref{}` as inline math, MathJax renders the
undefined label as `???`, leaving Principle ??? leaks in the HTML.
Pattern 4 detects `<span class="math inline">\(\ref{pri-X}\)</span>`
and substitutes the resolved `Principle N` link by replaying the
per-volume principle-callout count across parts/*_principles.qmd in
declared order. Cross-volume independent numbering.
Supporting changes:
- Add a Math handler to the custom-numbered-blocks Lua filter as a
conceptually-correct sibling to the existing RawInline handler.
Benign no-op cross-file (data isn't populated); lights up
automatically if the principles file is ever in the same Pandoc
invocation as the chapter that references it.
- Propagate the rename to epub_postprocess.py import, verify_rendered_xrefs.py
doc strings, scripts/README.md, and validate.py mention.
- Rename function fix_cross_references → resolve_cross_references.
18 KiB
18 KiB