docs_modules.py
Move the per-file reference listing off the landing page onto its own.
Overview
Move the per-file reference listing off the landing page onto its own.
The generator ends index.html with every file in the tree — 331 of them at
this size, one row each, grouped by directory. That is a useful index and a
terrible last impression: it is roughly 60% of the landing page's bytes, it
buries the Guides section a reader actually wants, and nobody scrolls a
homepage looking for ccc_shim_rx.c.
This pass cuts that section out and republishes it as modules.html, so the landing page ends at Guides and the listing gains a page where a directory heading is a heading rather than a speed bump. The feature card that used to jump to the #subsystems anchor now opens the page instead, and the listing grows a per-directory jump strip, which the anchor version never had room for.
Nothing here is curated: the rows, their order and their blurbs are the generator's, moved verbatim. The page is assembled from an existing rendered guide page, so it carries the current shell — sidebar, palette, theme toggle and the other passes' injections.
Run from the repo root, after docs_nav.py (whose Guides regex still needs the #subsystems heading in place) and before the link pass.
flowchart TD add --> slug
API
Fslug(directory: str) -> str
Turn a source directory path into an HTML id usable as a jump-strip anchor.
addFanchored(listing: str) -> tuple[str, list[tuple[str, str]]]
Give every directory heading in the listing an id, and return the listing with the directory names and ids collected in page order.
mainFadd(m: re.Match) -> str
Rewrite one directory heading to carry an anchor id, recording it.
slugFbuild_page(template: str, listing: str, dirs: list[tuple[str, str]]) -> str
Render modules.html: the template shell with its hero and main column replaced by the moved listing, its jump strip and the cross-links to the two neighbouring reference trees.
mainFwire_sidebar() -> int
Inject the sidebar Modules entry into every rendered page that has not got it already. Returns the number of pages changed.
mainFadd_search_row(title: str, page_name: str) -> None
Add an entry for the given page to the nav.js search array if not already present, so the palette finds the page by name. Does nothing silently if nav.js is absent.
mainFmain() -> int
Move the landing page's per-file reference listing into modules.html, repoint the feature card that used to jump to it, and register the new page with the search palette. Reports what moved; returns 1 if the landing page's layout no longer matches.
add_search_row, anchored, build_page, wire_sidebar