Repository navigation
docs: one nav manifest, validated, and every page reachable - #544
Merged
Merged
Conversation
The sidebar was a 280-line dict literal inside build_wiki.py, and the same information was hand-maintained in four other places: page_category for the search filter, write_llms_txt as a third index, the tutorial track order, and mkdocs.yml. They had drifted. docs/nav.json is now the single source. build_wiki.py reads it, and two things are checked on every build, both failures rather than warnings: - every nav entry resolves to a real page - every page under docs/ is either in the nav or listed in "unlisted" with a written reason The first check immediately found project/PROJECT_STRUCTURE.md in the Project section, pointing at a file that only exists under archive/. It has been shipping as a dead sidebar link. The second found 55 pages that were in no sidebar at all, which for a reference manual means the information exists and cannot be found. The Language tab held 16 entries while docs/language/ had 36 pages. Missing from it: ordering, shaders, dynamics-dsl, lifetime-domains, safety-profiles, wasm-crossings, mlir-opt-flags, export-abi, modules-namespacing, multi-implementation, explainable-compilation, graphics-3d, c-fnptr-call, concurrency-vs-go, replace-go, debugging, flow-run, and the directory index. Rather than appending 18 rows to one long list, the Language tab is now five sections: Reference, Language features, Domain surfaces, Targets and interop, Comparisons. Domain surfaces is the one worth naming, since dynamics-dsl and shaders are the headline feature set and neither was reachable. Library splits into Standard library and Domain libraries; Tooling gains a Certification and compliance section for the five certification pages, none of which were in the sidebar. Eight pages are explicitly unlisted with reasons: three archived, plus internal runbooks and process notes that are not reader documentation. page_category now derives from the tab a page sits under, so a page cannot be filed under Language in the sidebar and reported as a guide in search. llms.txt is generated from the manifest as well; it was a hand-written 25-link index that neither link checker validated, because it is not markdown. JSON rather than YAML: the wiki CI job runs bare python3 with no setup-python and no pip install, so build_wiki.py has to stay stdlib-only. Language tab 16 entries to 31, Library 8 to 17, Tooling 4 to 12. Unit 1460 passed, ruff clean, wiki and doc links clean. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second of the wiki series, rebased onto main now that #540 has landed. Replaces #541, which carried #540's commits and could not rebase cleanly across the squash merge.
The problem
The sidebar was a 280-line dict literal inside
build_wiki.py:607-886, and the same information was hand-maintained in four other places:page_categoryfor the search filter,write_llms_txtas a third index, the tutorial track order, andmkdocs.yml. They had drifted.docs/nav.jsonis now the single source, and two things are checked on every build, both failures rather than warnings:docs/is either in the nav or listed inunlistedwith a written reasonbuild_wiki.pyexits non-zero on either, and the wiki job runs it, so this is gated without a new CI job.What the checks found
A dead sidebar link, shipping to readers. The Project section carried
project/PROJECT_STRUCTURE.md. That file only exists underarchive/.55 pages in no sidebar at all. For a reference manual that means the information exists and cannot be found. The Language tab had 16 entries while
docs/language/has 36 pages. Absent from it:The restructure
Appending 18 rows to one long list would have satisfied the checker and not the reader. The Language tab is now five sections:
Domain surfaces is the one worth calling out.
dynamics-dslandshadersare the headline feature set, theflow/evolves asmaterial the vision leads with, and neither page was reachable from the sidebar.Library splits into Standard library (7) and Domain libraries (10). Tooling gains a Certification & compliance section for the five
certification/pages, none of which were in the sidebar. Language 16 → 31, Library 8 → 17, Tooling 4 → 12.Eight pages are explicitly unlisted with reasons: three archived, plus internal runbooks and process notes that are not reader documentation.
The other drift sources
page_categorynow derives from the tab a page sits under. It was a separate prefix match, so a page could sit under Language in the sidebar and be reported as a guide in search.llms.txtis generated from the manifest. It was a hand-written 25-link index that neither link checker validated, because it is not markdown, so its paths could rot silently. It now covers everything.mkdocs.ymlis the remaining consumer and is left for a follow-up. I wrote and then removed amkdocs_nav()helper rather than ship an unused function.Why JSON and not YAML
The plan said YAML. The wiki job runs bare
python3with nosetup-pythonstep and nopip install:PyYAML is not in
requirements.txtor the lock file, so anythingbuild_wiki.pyimports has to be standard library. JSON is also already the output format.Validation
scripts/wiki_nav.pyreports the manifest consistent withdocs/check_doc_links.py,check_doc_coverage.pyandcheck_wiki_links.pyall clean against merged main