Skip to content

RDoc-3631 Panel headings are missing from TOC - #2659

Merged
ppekrol merged 1 commit into
ravendb:mainfrom
poissoncorp:RDoc-3631-panel-headings-in-toc
Sep 11, 2026
Merged

RDoc-3631 Panel headings are missing from TOC#2659
ppekrol merged 1 commit into
ravendb:mainfrom
poissoncorp:RDoc-3631-panel-headings-in-toc

Conversation

@poissoncorp

Copy link
Copy Markdown
Contributor

Issue link

https://issues.hibernatingrhinos.com/issue/RDoc-3631

Additional description

Docusaurus builds the "In this article" list at compile time and only looks at Markdown headings. <Panel heading="..."> is a JSX prop, so panel headings were invisible to it. On 70 current-version pages that box was completely empty, and on the rest the panel sections were missing while their subheadings showed up flat, with no hint of which panel they belonged to.

A new remark-panel-headings plugin turns the prop into a real Markdown heading before Docusaurus collects the TOC, and Panel renders that heading instead of the prop. The rendered markup and CSS are identical to before, so panels look exactly the same.

The plugin assigns the id itself, reusing the rule the component used at render time. Every panel link that works today keeps working; letting Docusaurus' slugger recompute the ids would have changed a lot of live anchors.

Before vs After

image image

Type of change

  • Content - docs
  • Content - cloud
  • Content - Quill
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

Docusaurus builds the right-hand TOC at MDX compile time and its remark/toc
plugin only collects Markdown heading nodes (plus TOC slices of imported .mdx
partials). `<Panel heading="...">` is a JSX prop, so 1733 panel headings across
400 current-version pages never reached the TOC - 70 pages had an empty "In
this article" box.

Add a `remark-panel-headings` plugin, registered as `beforeDefaultRemarkPlugins`
on every content instance, which hoists the prop into a real heading node
before the default `headings` and `toc` plugins run. The anchor id is pre-set
with the slug the component used to compute at render time, and
`remark/headings` honours it, so every panel anchor stays valid (github-slugger
would have rewritten 175 of them).

Heading ids are now a build-time concern only: `Panel` renders the hoisted
heading it receives as its first child and knows nothing about ids or the TOC.
A heading the plugin cannot hoist (an expression instead of a plain string) is
reported with its file path; no such panel exists in the content today.

Panel ids also take part in per-file dedup now, so a panel heading that
duplicates a Markdown heading on the same page gets a `-1` suffix instead of a
duplicate id (4 pages). The links that pointed at the shared id resolved to the
first occurrence before and still do.
@poissoncorp
poissoncorp requested a review from Lwiel September 9, 2026 12:54
@ppekrol
ppekrol merged commit c681ba4 into ravendb:main Sep 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.

3 participants