docs_api.py
Fill the reference pages the page generator leaves bare.
Overview
Fill the reference pages the page generator leaves bare.
The generator documents code where it is defined: functions with bodies, structs, inline helpers. A header that only *declares* things — prototypes, macros, enums — renders as a hero line and a "used by" row, which reads as an empty page even when every declaration in the file carries a doc comment.
This pass parses those headers straight from the working tree and appends the missing declarations in the generator's own api-entry markup, so the "On this page" rail and the search palette treat them like any other entry:
* function prototypes (with their /** brief */ if present),
* documented #defines, plus undocumented value-carrying ones — a pin map
is worth listing even uncommented; include guards are not,
* enum/struct/union declarations the page does not already show.
Anything the page already renders is skipped by anchor id, so running after the generator adds only what it left out. New entries are also appended to the search index in nav.js. Run from the repo root, after docs_graph.py and before the link pass.
API
Fclean_brief(raw: str) -> str
Doc-comment text -> one inline-HTML sentence, generator style.
parse_headerFclassify(decl: str) -> tuple[str, str, str] | None
A flattened ...; declaration -> (kind, name, signature) or None.
parse_headerFparse_header(text: str) -> list[tuple[int, str, str, str, str]]
-> [(line, kind, name, signature, brief-html)] for every declaration.
fill_page · calls classify, clean_briefFfill_page(page_path: Path) -> list[tuple[str, str, str, str]]
-> [(kind, name, anchor-href)] appended to this page.
main · calls entry_html, parse_headerFindex_rows(rows: list[tuple[str, str, str, str]]) -> int
Append new entries to the search palette's index in nav.js.
mainUndocumented (2)
entry_html, main