Functions | |
| dict | load_contract () |
| Load the published-site integrity contract. | |
| list[Path]|None | git_tracked_files () |
| List tracked plus non-ignored untracked files, so the scan set is reproducible for a commit and generated scratch is excluded without excluding tracked docs. | |
| iter_scannable () | |
| Yield repository files whose text may carry project-owned URLs. | |
| Path | require_built_html (dict contract) |
| Resolve the generated HTML tree, failing loudly when it has not been built. | |
| list[str] | check_forbidden_urls (dict contract) |
| Reject project-owned URL forms that are known not to resolve. | |
| list[str] | check_canonical_urls (dict contract, Path html_dir) |
| Verify every canonical documentation URL names a page the build actually generates. | |
| list[str] | check_layout (dict contract, Path html_dir) |
| Verify every Doxygen layout tab resolves to a generated page. | |
| list[str] | check_orphan_pages (dict contract, Path html_dir) |
| Verify every page the build publishes is reachable from the navigation. | |
| list[str] | check_generated_fragment_links (Path html_dir) |
| Verify every link emitted by a generated fragment resolves in the rendered page. | |
| str | strip_non_prose (str text) |
| Blank out fenced code, inline code, and HTML comments. | |
| list | markdown_fragment_links (str text) |
| Extract Markdown links carrying a fragment, from prose only. | |
| list | tracked_markdown () |
| Every Markdown file the current commit carries. | |
| set | rendered_ids (Path path) |
| Anchor ids present in a rendered HTML page. | |
| str | heading_anchor (str text) |
| GitHub-style anchor slug for a Markdown heading. | |
| set | markdown_anchors (Path path) |
| Anchors a plain Markdown file offers. | |
| list[str] | check_page_cross_references (Path html_dir) |
| Verify hand-written Markdown fragment links resolve, repository-wide. | |
| int | main () |
| Fail when a project-owned URL is dead or a navigation tab has no generated page. | |
Variables | |
| REPO_ROOT = Path(__file__).resolve().parents[2] | |
| str | CONTRACT_PATH = REPO_ROOT / "tests" / "tooling" / "docs_site_contract.json" |
| dict | SKIP_DIRS = {".git", "docs_build", "obj", "bin", "stubs", "runs", "studies", "__pycache__", ".pytest_cache"} |
| dict | SCAN_SUFFIXES = {".md", ".js", ".xml", ".html", ".yml", ".yaml"} |
Verify published-site integrity against the generated HTML, not against source declarations.
| dict audit_docs_site.load_contract | ( | ) |
Load the published-site integrity contract.
Definition at line 23 of file audit_docs_site.py.
| list[Path] | None audit_docs_site.git_tracked_files | ( | ) |
List tracked plus non-ignored untracked files, so the scan set is reproducible for a commit and generated scratch is excluded without excluding tracked docs.
Definition at line 31 of file audit_docs_site.py.
| audit_docs_site.iter_scannable | ( | ) |
Yield repository files whose text may carry project-owned URLs.
Definition at line 40 of file audit_docs_site.py.
| Path audit_docs_site.require_built_html | ( | dict | contract | ) |
Resolve the generated HTML tree, failing loudly when it has not been built.
| [in] | contract | Parsed contract mapping. |
| RuntimeError | when the publication artifact is absent. |
Definition at line 56 of file audit_docs_site.py.
| list[str] audit_docs_site.check_forbidden_urls | ( | dict | contract | ) |
Reject project-owned URL forms that are known not to resolve.
| [in] | contract | Parsed contract mapping. |
Definition at line 72 of file audit_docs_site.py.
| list[str] audit_docs_site.check_canonical_urls | ( | dict | contract, |
| Path | html_dir | ||
| ) |
Verify every canonical documentation URL names a page the build actually generates.
| [in] | contract | Parsed contract mapping. |
| [in] | html_dir | Generated HTML directory. |
Definition at line 91 of file audit_docs_site.py.
| list[str] audit_docs_site.check_layout | ( | dict | contract, |
| Path | html_dir | ||
| ) |
Verify every Doxygen layout tab resolves to a generated page.
| [in] | contract | Parsed contract mapping. |
| [in] | html_dir | Generated HTML directory. |
Definition at line 112 of file audit_docs_site.py.
| list[str] audit_docs_site.check_orphan_pages | ( | dict | contract, |
| Path | html_dir | ||
| ) |
Verify every page the build publishes is reachable from the navigation.
A page is reachable when another page adopts it with a subpage directive, or when a layout tab points at it directly. A page that is generated but adopted by nothing renders in the site with no route to it except search.
| [in] | contract | Parsed contract mapping. |
| [in] | html_dir | Generated HTML directory. |
Definition at line 133 of file audit_docs_site.py.
| list[str] audit_docs_site.check_generated_fragment_links | ( | Path | html_dir | ) |
Verify every link emitted by a generated fragment resolves in the rendered page.
Generated tables link into Tier-2 entries. Doxygen does not validate raw HTML inserted through an HTML include, so a fragment pointing at an anchor that was never written renders as a dead link and passes every other gate.
| [in] | html_dir | Generated HTML directory. |
Definition at line 171 of file audit_docs_site.py.
| str audit_docs_site.strip_non_prose | ( | str | text | ) |
Blank out fenced code, inline code, and HTML comments.
A link shown inside an example is documentation of a link, not a link. Replacing the spans with blanks rather than deleting them keeps line numbers meaningful for any future line-accurate reporting.
| [in] | text | Raw Markdown text. |
Definition at line 222 of file audit_docs_site.py.
| list audit_docs_site.markdown_fragment_links | ( | str | text | ) |
Extract Markdown links carrying a fragment, from prose only.
Covers [t](#frag), [t](#frag "title"), and [t](page.md#frag), and accepts every legal fragment character rather than only word characters - a hyphenated anchor is the common Markdown style and was previously invisible to this check.
| [in] | text | Raw Markdown text. |
Definition at line 247 of file audit_docs_site.py.
| list audit_docs_site.tracked_markdown | ( | ) |
Every Markdown file the current commit carries.
Uses the same git-backed enumeration as the link checker, so fragment validation covers README, example documentation, and every guide.md rather than only the Doxygen page tree.
Definition at line 273 of file audit_docs_site.py.
| set audit_docs_site.rendered_ids | ( | Path | path | ) |
Anchor ids present in a rendered HTML page.
| [in] | path | Rendered page. |
Definition at line 288 of file audit_docs_site.py.
| str audit_docs_site.heading_anchor | ( | str | text | ) |
GitHub-style anchor slug for a Markdown heading.
| [in] | text | Heading text without its leading hashes. |
Definition at line 302 of file audit_docs_site.py.
| set audit_docs_site.markdown_anchors | ( | Path | path | ) |
Anchors a plain Markdown file offers.
A file that Doxygen does not render still has targets: explicit HTML anchors, and the heading slugs a Markdown viewer generates.
| [in] | path | Markdown file. |
Definition at line 314 of file audit_docs_site.py.
| list[str] audit_docs_site.check_page_cross_references | ( | Path | html_dir | ) |
Verify hand-written Markdown fragment links resolve, repository-wide.
Doxygen validates its own reference graph, but a Markdown fragment link is checked by nothing. Cross-page targets are resolved relative to the linking file, so the many guide.md files in this repository are not conflated by basename.
| [in] | html_dir | Generated HTML directory. |
Definition at line 331 of file audit_docs_site.py.
| int audit_docs_site.main | ( | ) |
Fail when a project-owned URL is dead or a navigation tab has no generated page.
Definition at line 381 of file audit_docs_site.py.
| audit_docs_site.REPO_ROOT = Path(__file__).resolve().parents[2] |
Definition at line 17 of file audit_docs_site.py.
| str audit_docs_site.CONTRACT_PATH = REPO_ROOT / "tests" / "tooling" / "docs_site_contract.json" |
Definition at line 18 of file audit_docs_site.py.
| dict audit_docs_site.SKIP_DIRS = {".git", "docs_build", "obj", "bin", "stubs", "runs", "studies", "__pycache__", ".pytest_cache"} |
Definition at line 19 of file audit_docs_site.py.
| dict audit_docs_site.SCAN_SUFFIXES = {".md", ".js", ".xml", ".html", ".yml", ".yaml"} |
Definition at line 20 of file audit_docs_site.py.