Skip to content
Snippets Groups Projects
Unverified Commit c8bbcc2d authored by Patrick Marsceill's avatar Patrick Marsceill
Browse files

Merge branch 'collapsible-toc' of git://github.com/pdmosses/just-the-docs into...

Merge branch 'collapsible-toc' of git://github.com/pdmosses/just-the-docs into pdmosses-collapsible-toc
parents 85fa222f e40ba9c6
No related branches found
No related tags found
No related merge requests found
......@@ -7,11 +7,14 @@ nav_order: 5
# Navigation Structure
{: .no_toc }
## Table of contents
{: .no_toc .text-delta }
<details open markdown="block">
<summary>
Table of contents
</summary>
{: .text-delta }
1. TOC
{:toc}
</details>
---
......@@ -231,4 +234,19 @@ To generate a Table of Contents on your docs pages, you can use the `{:toc}` met
{: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).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment