How to limit TOC level in wiki in Azure DevOps
Asked Answered
C

2

7

I cannot see here https://learn.microsoft.com/en-us/azure/devops/project/wiki/wiki-markdown-guidance?view=azure-devops#table-of-contents-toc-for-wiki-pages any rule to do something like that:

[[__TOC__ limit:3]]

To limit the level of collected headers. Is it possible?

Cato answered 21/10, 2021 at 12:1 Comment(0)
A
6

I had the same question and found a workaround. This ADO help page mentions "Only Markdown headings are considered for TOC (HTML heading tags aren't considered)."

For example, to eliminate the duplicate page title in the embedded TOC, I used <h1>page title</h1> instead of #page title. This eliminated the page title from the embedded TOC, but the page title still rendered in the same visual style on the wiki page. The same approach worked for subtitles: using <h3>subtitle</h3> instead of ###subtitle rendered the subtitle appearing like a subtitle in the wiki page, but kept it out of the TOC.

It's a manual approach but it helped keep the TOC simplified which is what I wanted.

Agamemnon answered 13/11, 2023 at 18:58 Comment(0)
M
9

Unfortunately this isn't supported and this closed item, "Specify the TOC depth level", suggests it will not be supported.

Mackinaw answered 21/10, 2021 at 15:21 Comment(0)
A
6

I had the same question and found a workaround. This ADO help page mentions "Only Markdown headings are considered for TOC (HTML heading tags aren't considered)."

For example, to eliminate the duplicate page title in the embedded TOC, I used <h1>page title</h1> instead of #page title. This eliminated the page title from the embedded TOC, but the page title still rendered in the same visual style on the wiki page. The same approach worked for subtitles: using <h3>subtitle</h3> instead of ###subtitle rendered the subtitle appearing like a subtitle in the wiki page, but kept it out of the TOC.

It's a manual approach but it helped keep the TOC simplified which is what I wanted.

Agamemnon answered 13/11, 2023 at 18:58 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.