Section table of contents (::section-toc)
We support the following syntax for displaying an inline table of contents based on the Markdown file's headings:
Markdown
::section-toc
::section-toc[<optional-title>]
::section-toc[<optional-title>]{depth=<optional-depth>}
The displayed table of contents (TOC) is based on the hierarchy of Markdown headings within the current section. You can customize the displayed TOC with the following options:
- Specifying a title in square brackets displays the title above the TOC
- Specifying a
depthcaps the nesting depth of headings included in the TOC (for example, withdepth=1inside a#heading's section, only a flat list of the section's##headings are included)
info
Section 3 will be ignored the following example
Example:
Markdown
## Section 2
::section-toc
::section-toc[Table of Contents]
::section-toc[Shallow Table of Contents]{depth=1}
### Section 2.1
#### Section 2.1.1
### Section 2.2
#### Section 2.2.1
#### Section 2.2.2
## Section 3
Output:
Section 2
Table of Contents
Shallow Table of Contents