You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/navigation/in-page.md
+21-5Lines changed: 21 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,27 @@ To support in-page navigation, you can generate a *Table of Contents* (TOC) with
19
19
20
20
To generate a *Table of Contents* in a page, you use Kramdown's `{:toc}` method, immediately after the start of a list. This will automatically generate a list of anchor links to various sections of the page, based on headings and heading levels.
21
21
22
+
{: .note }
23
+
`{:toc}` can be used only once on each page.
24
+
25
+
You **must** have a list immediately preceding the table of contents. The type of list determines the style of your table of contents.
26
+
27
+
For an *ordered* table of contents, use the following markdown code:
28
+
29
+
```md
30
+
1. TOC
31
+
{:toc}
32
+
```
33
+
34
+
The `{:toc}` line *must* follow the `1. TOC` line, which begins a list.
35
+
36
+
For an *unordered* table of contents, instead use the following markdown code:
37
+
38
+
```
39
+
- TOC
40
+
{:toc}
41
+
```
42
+
22
43
## Omitting Heading from Table of Contents
23
44
24
45
If you want to omit a particular heading from the TOC, follow it immediately by `{: .no_toc }` (possibly together with other CSS class names).
@@ -36,8 +57,6 @@ If you want to omit a particular heading from the TOC, follow it immediately by
36
57
37
58
This example omits the top-level heading (`In-Page Navigation`) from the TOC, as well as the heading for the *Table of Contents* itself.
38
59
39
-
To get an unordered list, replace `1. TOC` by `- TOC` in the above example.
40
-
41
60
## Collapsible Table of Contents (with `<details>` and `<summary>`)
42
61
43
62
You can make the Table of Contents collapsible using the `<details>` and `<summary>` elements, as in the following example.
@@ -55,9 +74,6 @@ You can make the Table of Contents collapsible using the `<details>` and `<summa
55
74
56
75
The attribute `open` (which expands the Table of Contents by default) and the styling (here with `text-delta`) are optional.
0 commit comments