{"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"page-table-of-contents","__idx":0},"children":["Page table of contents"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"danger","name":"Deprecated docs"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The developer portal beta is ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/product-timelines"},"children":["approaching end of life"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use Realm and Reunite instead. Read the ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs-legacy/developer-portal/migrate-from-legacy-portal"},"children":["migration guide"]},"."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Important"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Page table of contents is supported on MDX pages starting with version ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1.1.0-beta.47"]}," of the Portal."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The same Portal version introduced changes to table of contents configuration options. This guide has been updated to distinguish between the ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Old"]}," and ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["New"]}," configuration approach."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add a table of contents (TOC) automatically to any Markdown or MDX page."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can see an example of what it looks like on the right side of this page."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide describes:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["How to enable or disable the TOC globally"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["How to override TOC settings for any specific page(s)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["How content is sourced for the TOC"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configure-the-toc-globally","__idx":1},"children":["Configure the TOC globally"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To enable the TOC on all pages, add this to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["siteConfig.yaml"]}," file:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"New","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"toc:\n  enable: true\n","lang":"yaml"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Old","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"enableToc: true\n","lang":"yaml"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The TOC is disabled by default. If you want to disable it explicitly, add this to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["siteConfig.yaml"]},":"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"New","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"toc:\n  enable: false\n","lang":"yaml"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Old","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"enableToc: false\n","lang":"yaml"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"control-the-toc-maximum-depth","__idx":2},"children":["Control the TOC maximum depth"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can control the maximum depth of the TOC. The maximum depth refers to how many heading levels render in the TOC (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h1"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h2"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h3"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h4"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h5"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h6"]},"...)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set it using a numeric value corresponding to the heading level."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The default value in the portal is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4"]},", meaning the portal displays ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h1"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h2"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h3"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h4"]}," headings in the TOC (except for the initial ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h1"]},", which is interpreted as the page title)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can adjust the maximum depth in ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs-legacy/developer-portal/configuration/siteconfig/table-of-contents"},"children":["the siteConfig.yaml file"]}," or in the front matter of any page."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"New","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"toc:\n  enable: true\n  maxDepth: 3\n","lang":"yaml"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Old","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"enableToc: true\ntocMaxDepth: 3\n","lang":"yaml"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"override-page-toc-settings","__idx":3},"children":["Override page TOC settings"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can override the global setting in the ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs-legacy/developer-portal/guides/markdown#front-matter"},"children":["front matter"]}," of any Markdown or MDX page."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the following example, the TOC is hidden on the page even if it is enabled globally."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"New","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"---\nseo:\n  title: Markdown example\n  description: GitHub-Flavored Markdown example\ntoc:\n  enable: false\n---\nExample text\n","lang":"yaml"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Old","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"---\ntitle: Markdown example\ndescription: GitHub-Flavored Markdown example\nenableToc: false\n---\nExample text\n","lang":"yaml"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open and close the front matter appropriately using three or more dashes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["---"]},", or the front matter is invalid and display as text on your page."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"source-of-toc-content","__idx":4},"children":["Source of TOC content"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The TOC content comes from the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h2"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h3"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h4"]}," tags on the page."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It is also sourced from any additional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h1"]}," tags except the opening ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h1"]}," tag."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"a-second-h1-example","__idx":5},"children":["A second h1 example"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"danger","name":"Deprecated docs"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The developer portal beta is ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/product-timelines"},"children":["approaching end of life"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use Realm and Reunite instead. Read the ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs-legacy/developer-portal/migrate-from-legacy-portal"},"children":["migration guide"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"an-h2-example","__idx":6},"children":["An h2 example"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"an-h3-example","__idx":7},"children":["An h3 example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Any ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h3"]}," content appears indented."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"and-an-h4-example","__idx":8},"children":["And an h4 example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Any ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h4"]}," content appears further indented."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"and-an-h5-too","__idx":9},"children":["And an h5 too"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Any ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["h5"]}," content does appear in the page table of contents."]}]},"frontmatter":{"seo":{"title":"Add the table of contents to a page"},"excludeFromSearch":true},"tagList":["admonition","partial","tab","tabs"],"title":"Add the table of contents to a page","lastModified":"2025-05-28T16:01:32.000Z"}