You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(docs): move inline TOC to a responsive left sidebar; preserve logo aspect ratio
Doc pages with `:toc:` used to render the TOC as a long inline block at
the top of the body. On longer pages (Harness Inventory, Socratic Recovery
Skill, the Brownfield reports) that pushed the actual content far below
the fold.
- render-docs.js extracts the `<div id="toc">` block from each rendered
page into a sidecar `<basename>.toc.html` (depth-counting parser so
nested ULs are handled cleanly). Pages without a TOC produce no sidecar.
- doc-page.js wraps content in a two-slot flex layout: a sticky left
sidebar on lg+ and a bordered, height-capped block above the content on
smaller screens. The aside is hidden by default and only appears when a
sidecar fetch returns an actual TOC fragment. A content-type-style
sanity check rejects the Vite SPA fallback (index.html served as 200 OK
for missing files), so pages without a TOC keep full-width content.
- TOC in-page links bypass the SPA router (which only handles `#/...`
routes) and scroll smoothly to the target heading.
- asciidoctor-scoped.css gets a `.doc-toc` block with sticky-sidebar
styling — small caps title, indented nested lists with a left border,
hover backgrounds matching the theme tokens.
Also fixes a separate report: the header logo lost its aspect ratio on
narrow screens. Tailwind's preflight `max-width: 100%` was clamping the
img width while the height stayed pinned by `h-24`/`h-16`. Adding
`max-w-none shrink-0` keeps the declared dimensions intact at every
viewport.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments