Skip to main content

Module schema_docs

Module schema_docs 

Source
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:

  1. Content-model rendering — pretty-print RelaxNG-style structural expressions (A , B | C?) from one-line walls into operator-leading multi-line layout. Replaces tools/render-content-models.py.

  2. Definition-card decoration — promote schema.X anchor ids onto parent <dt> elements, wrap kind words (“Pattern” / “Element” / “Attribute” / “Add to”) in chip spans, and append § permalink anchors. Replaces tools/decorate-definitions.py.

  3. 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 --css when --schemadocs is on, so callers don’t need to remember it. The orchestration shell copies the source CSS into $output_dir under 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 --javascript when --schemadocs is on. The orchestration shell copies the source JS into $output_dir under the same basename so the relative <script src> resolves.

Functions§

process_page
Run the schema-doc passes on a single page’s HTML.