Table of Contents

Jul 29, 2017

Capsule can automatically generate a table of contents for each page. Simply set in the front matter (toml):

toc = true

The title from every # is used to generate each item in the table. The lesser the header is in the page hierarchy, the more it will be nested. See below.

Example 1

Consider the following header hierarchy:

## Section 1 (h2)
...

### Section 2 (h3)
...

#### Section 3 (h4)
...

##### Section 4 (h5)
...

###### Section 5 (h6)
...

## Section 6 (h2)
...

### Section 7 (h3)
...

It yields the follow table of contents:


Last edited: Apr 20, 2021


Categories:
Tags: