Skip to content

docs: style the landing-page table of contents - #110

Merged
vito merged 2 commits into
mainfrom
docs-toc-styling
Jun 11, 2026
Merged

vito merged 2 commits into
mainfrom
docs-toc-styling

Conversation

@vito

@vito vito commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Addresses docs feedback on the landing page: the TOC was booklit's default rendering — a plain nested bulleted list with section numbers inside the link text — and the reader asked for it to be styled tastefully as an actual table of contents.

This overrides toc.tmpl (project templates in docs/html/ shadow booklit's defaults) and styles it in page.tmpl:

  • A Contents block with the same small-caps label treatment as the sidebar headings.
  • One row per chapter: the section number sits in its own right-aligned muted monospace column, outside the link text.
  • Each chapter's sections render as a compact dot-separated inline run beneath the chapter title, in smaller muted type.
  • Depth is capped at two levels. The old TOC recursed into third-level headings (~50 entries like "Double-quoted", "Named"), which is deeper than a skim-friendly landing page needs — the sidebar and per-page headings still cover those.

The feedback widget skips everything inside <nav>, so the new markup is ignored by it just like the old TOC was. Only the landing page uses \table-of-contents, so nothing else is affected.

Note: the > Meta: blockquote above the TOC still says "don't try to build a full TOC here" — left untouched per convention, but it may be worth updating to reflect that a curated two-level TOC is intentional now.

🤖 Generated with Claude Code

Reader feedback on the landing page: the TOC is useful but renders as
booklit's default — a plain nested bulleted list with section numbers
inside the link text. Override toc.tmpl to render it as an actual
contents block: a small-caps "Contents" label, one row per chapter with
the number in its own muted monospace column outside the link, and the
chapter's sections as a compact dot-separated run underneath. Depth is
capped at two levels; the old TOC recursed into third-level headings
("Double-quoted", "Named", ...), which is more detail than a
skim-friendly landing page needs. The feedback widget already skips
<nav> elements, so the new markup stays out of its reach like the old
one did.

Signed-off-by: Alex Suraci <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Deploying dang with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8c8d07a
Status: ✅  Deploy successful!
Preview URL: https://674b3426.dang-3kk.pages.dev
Branch Preview URL: https://docs-toc-styling.dang-3kk.pages.dev

View logs

The note said "don't try to build a full TOC here", which now
contradicts the page: the curated two-level contents block is
intentional. Describe the actual shape — chapters plus their sections,
depth capped by toc.tmpl — and keep the pointer that deeper navigation
belongs to the sidebar and the pages themselves.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito merged commit 2990765 into main Jun 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant