Add a table of contents (TOC) automatically to any Markdown page.
You'll notice it on this page on the right-side of the page.
This page will explain:
- How the content is sourced for the TOC
- How to enable or disable the TOC globally
- How to override any setting for any specific page(s)
Enable the TOC on all pages by adding this to the
The TOC is disabled by default. If you want to disable it explicitly, add this to the
You may also control the maximum depth of the TOC.
This means if it will render
Set it using a numeric value corresponding to the heading level.
The developer portal defaults to a
4, meaning it will render
h4 tags (except for the initial
It may be adjusted within the
siteConfig.yaml or in the front matter of any page.
You may override the global setting in the front matter of a Markdown-based page:
--- enableToc: false ---
--- enableToc: true ---
You may augment other front matter, by adding a new line.
--- title: Markdown example description: GitHub-Flavored Markdown example enableToc: true ---
The content of the TOC is sourced from the
h4 tags on the page.
It is also sourced from any additional
h1 tags excluding an opening
Page TOC is not supported on MDX pages.
h3 content will appear indented.
h4 content will appear further indented.
h5 content will not appear in the page table of contents.