mirror of
https://github.com/thangisme/notes.git
synced 2025-01-18 05:56:22 -05:00
Update documentation with collapsible TOC
Makes the TOC at the top of the page collapsible. Adds an explanation of the markup used to produce a collapsible TOC. Adds a comment about the possibility of using an unordered list for the TOC, and about using TOC only once per page.
This commit is contained in:
parent
bf031eb68b
commit
e40ba9c6c5
@ -7,11 +7,14 @@ nav_order: 5
|
|||||||
# Navigation Structure
|
# Navigation Structure
|
||||||
{: .no_toc }
|
{: .no_toc }
|
||||||
|
|
||||||
## Table of contents
|
<details open markdown="block">
|
||||||
{: .no_toc .text-delta }
|
<summary>
|
||||||
|
Table of contents
|
||||||
|
</summary>
|
||||||
|
{: .text-delta }
|
||||||
1. TOC
|
1. TOC
|
||||||
{:toc}
|
{:toc}
|
||||||
|
</details>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -224,4 +227,19 @@ To generate a Table of Contents on your docs pages, you can use the `{:toc}` met
|
|||||||
{:toc}
|
{:toc}
|
||||||
```
|
```
|
||||||
|
|
||||||
This example skips the page name heading (`#`) from the TOC, as well as the heading for the Table of Contents itself (`##`) because it is redundant, followed by the table of contents itself.
|
This example skips the page name heading (`#`) from the TOC, as well as the heading for the Table of Contents itself (`##`) because it is redundant, followed by the table of contents itself. To get an unordered list, replace `1. TOC` above by `- TOC`.
|
||||||
|
|
||||||
|
The table of contents can be made collapsible by adding HTML markup, as in the following example. The attribute `open` and the styling with `{: .text-delta }` are optional.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
<details open markdown="block">
|
||||||
|
<summary>
|
||||||
|
Table of contents
|
||||||
|
</summary>
|
||||||
|
{: .text-delta }
|
||||||
|
1. TOC
|
||||||
|
{:toc}
|
||||||
|
</details>
|
||||||
|
```
|
||||||
|
|
||||||
|
The result is shown at [the top of this page](#navigation-structure) (`{:toc}` can be used only once on each page).
|
||||||
|
Loading…
Reference in New Issue
Block a user