Expand description
Schema-doc post-processing — visual customizations for --splitat=section
schema documentation.
Three string-level passes run against each split sub-page after the standard LaTeXML XSLT has produced HTML:
-
Content-model rendering — pretty-print RelaxNG-style structural expressions (
A , B | C?) from one-line walls into operator-leading multi-line layout. Replacestools/render-content-models.py. -
Definition-card decoration — promote
schema.Xanchor ids onto parent<dt>elements, wrap kind words (“Pattern” / “Element” / “Attribute” / “Add to”) in chip spans, and append§permalink anchors. Replacestools/decorate-definitions.py. -
Sidebar item index + module narrative — collect each page’s Pattern/Element/Attribute definitions and inject a per-module item index into the navbar, and prepend a curated narrative aside above the section heading (loaded from a TOML file). Replaces
tools/inject-module-sidebar.py.
All three passes are idempotent: re-running on already-processed HTML
is a no-op. The driver is process_page; load_summaries reads the
per-module narrative TOML once.
Constants§
- THEME_
CSS_ BASENAME - Filename of the rustdoc-styled theme stylesheet that ships next
to each schema-doc site. Auto-prepended to
--csswhen--schemadocsis on, so callers don’t need to remember it. The orchestration shell copies the source CSS into$output_dirunder this same basename so the relative<link>resolves. - THEME_
JS_ BASENAME - Filename of the runtime script (theme-boot, popover wiring,
in-page filter). Auto-prepended to
--javascriptwhen--schemadocsis on. The orchestration shell copies the source JS into$output_dirunder the same basename so the relative<script src>resolves.
Functions§
- process_
page - Run the schema-doc passes on a single page’s HTML.