feat(site): a header on every page, and navigation for the docs (phase 5) - #68
Merged
Merged
Conversation
…e 5) Every page gets the same header: the calculator, the docs, the example report, and GitHub, with a theme toggle. The doc pages get a grouped docs sidebar, an "On this page" contents list that follows the section in view, a link on every h2 and h3 that copies itself, previous and next links, an "Edit on GitHub" link, and copy buttons on code blocks. All of the navigation is HTML written by build_site.py, so it works with scripts off and check_site_links.mjs verifies every link it adds. The renderer now also returns each doc's headings and per-section text (the search index in the next phase reads the latter), emits the heading links itself rather than through raw HTML, and turns table alignment into classes so no page carries an inline style. site/site.js adds only conveniences. theme.js applies a remembered theme before paint, so a dark choice does not flash light. Form borders and the histogram's bars now meet 3:1 contrast in both themes (part of #53). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Sep 23, 2026
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.
The site had one navigation device: a wrapping row of links at the top of each page. METHODOLOGY and PLAN are long enough that moving around them meant scrolling and searching the page. This is the first of three phases that give the site real structure without changing its voice or its rules (no external requests, docs rendered from the commit, parity with the Python).
What a reader gets
#link on every h2 and h3 that copies itself;Why it is built this way
build_site.py, so it works with scripts off, andcheck_site_links.mjsalready verifies every link and fragment it adds.site/site.jsadds conveniences only.site/theme.jsapplies a remembered theme before first paint.render_docs.mjsnow returns each doc's headings and per-section text. Phase 6 (search) reads the section text.<!-- site:header -->slot. The build refuses if the slot is missing, and checks that before deleting anything.Checked
ruff,mypy --strict, andpytestpass (483 tests). The 10 new tests intests/test_build_site.pycover the header, sidebar, contents list, and previous/next.render_docs.mjs --self-testpasses 20 cases.check_floor_parity.mjsandcheck_site_links.mjspass on the built site (11 pages).Next: phase 6 (search), then phase 7 (the explainer's opening block, CSP, and #25, #53, #55, #57).
🤖 Generated with Claude Code