Skip to content

feat: render page table of contents beside documentation - #15

Merged
barredterra merged 11 commits into
version-15from
copilot/render-toc-on-right-side
Aug 12, 2026
Merged

feat: render page table of contents beside documentation#15
barredterra merged 11 commits into
version-15from
copilot/render-toc-on-right-side

Conversation

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Documentation pages already expose sanitized heading TOC HTML, but the client discarded it. This renders that TOC beside wide-layout content and preserves heading hash navigation.

Rendering

  • Add a semantic TOC pane to the docs template.
  • Populate it from get_page().toc_html.
this.$toc.html(toc_html);
this.$toc_pane.toggleClass("hide", !toc_html);

Layout and navigation

  • Show a sticky right-hand TOC at wide viewports; hide it below the wide breakpoint.
  • Retain the original centered layout for pages without headings.
  • Scroll to matching rendered headings when a page opens with a URL fragment.

Coverage

  • Assert server TOC entries target generated heading IDs.
  • Add browser coverage for TOC links and hash deep links.

Copilot AI and others added 2 commits August 12, 2026 14:21
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Copilot AI changed the title [WIP] Add table of contents to the right of content Render page table of contents beside documentation Aug 12, 2026
Copilot AI requested a review from barredterra August 12, 2026 14:25
@barredterra

Copy link
Copy Markdown
Member

@copilot resolve merge conflicts

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve merge conflicts

Resolved in merge commit 4746751, preserving both the TOC/deep-link behavior and the target branch’s localized-page fallback notice.

@barredterra barredterra changed the title Render page table of contents beside documentation feat: render page table of contents beside documentation Aug 12, 2026
@barredterra
barredterra marked this pull request as ready for review August 12, 2026 15:13
@barredterra
barredterra enabled auto-merge (squash) August 12, 2026 15:14
@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Load documentation page] --> B[Render page content and TOC]
    B --> C[Start Mermaid rendering]
    C --> D[Store rendering promise as layout_ready]
    D --> E{URL has fragment?}
    E -- No --> F[Display page]
    E -- Yes --> G[Wait for layout_ready]
    G --> H{Still viewing same page?}
    H -- No --> F
    H -- Yes --> I[Decode heading ID]
    I --> J[Scroll rendered heading into view]
    K[Click TOC link] --> L[Replace URL fragment locally]
    L --> G
Loading

Reviews (3): Last reviewed commit: "style: format with prettier" | Re-trigger Greptile

Comment thread compendium/compendium/page/docs/docs.js Outdated
Comment thread compendium/compendium/page/docs/docs.js
@barredterra
barredterra merged commit c6b4dc1 into version-15 Aug 12, 2026
4 checks passed
@barredterra
barredterra deleted the copilot/render-toc-on-right-side branch August 12, 2026 16:04
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.

Render page table of contents on the right of the content

2 participants