diff --git a/CHANGELOG.md b/CHANGELOG.md index a8cfd97..6a26c83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,11 +23,14 @@ Code changes to `main` that are *not* in the latest release: Docs changes made since the latest release: - Fixed: incorrect docs for example with minimal layout parent, default layout child by [@janbrasna] in [#1540] +- Fixed: unclear docs on using in-page table of contents by [@sebjameswml] in [#1551] [@janbrasna]: https://github.com/janbrasna +[@sebjameswml]: https://github.com/sebjameswml [#1461]: https://github.com/just-the-docs/just-the-docs/pull/1461 [#1540]: https://github.com/just-the-docs/just-the-docs/pull/1540 +[#1551]: https://github.com/just-the-docs/just-the-docs/pull/1551 [#1590]: https://github.com/just-the-docs/just-the-docs/pull/1590 ## Release v0.10.0 diff --git a/docs/navigation/in-page.md b/docs/navigation/in-page.md index cc96332..095b062 100644 --- a/docs/navigation/in-page.md +++ b/docs/navigation/in-page.md @@ -19,6 +19,27 @@ To support in-page navigation, you can generate a *Table of Contents* (TOC) with 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. +{: .note } +`{:toc}` can be used only once on each page. + +You **must** have a list immediately preceding the table of contents. The type of list determines the style of your table of contents. + +For an *ordered* table of contents, use the following markdown code: + +```md +1. TOC +{:toc} +``` + +The `{:toc}` line *must* follow the `1. TOC` line, which begins a list. + +For an *unordered* table of contents, instead use the following markdown code: + +``` +- TOC +{:toc} +``` + ## Omitting Heading from Table of Contents 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 This example omits the top-level heading (`In-Page Navigation`) from the TOC, as well as the heading for the *Table of Contents* itself. -To get an unordered list, replace `1. TOC` by `- TOC` in the above example. - ## Collapsible Table of Contents (with `
` and ``) You can make the Table of Contents collapsible using the `
` and `` elements, as in the following example. @@ -55,9 +74,6 @@ You can make the Table of Contents collapsible using the `
` and `