| 1 |
Top-level headers and the TOC |
| 2 |
============================= |
| 3 |
|
| 4 |
Your right table of contents will behave slightly differently depending on |
| 5 |
whether your page has one top-level header, or multiple top-level headers. See |
| 6 |
below for more information. |
| 7 |
|
| 8 |
An example with multiple top-level headers |
| 9 |
========================================== |
| 10 |
|
| 11 |
If a page has multiple top-level headers on it, then the in-page Table of Contents |
| 12 |
will show each top-level header. |
| 13 |
**On this page, there are multiple top-level headers**. As a result, the top-level |
| 14 |
headers all appear in the right Table of Contents. Here's an example of a page structure |
| 15 |
with multiple top-level headers: |
| 16 |
|
| 17 |
|
| 18 |
.. code-block:: rst |
| 19 |
|
| 20 |
My first header |
| 21 |
=============== |
| 22 |
|
| 23 |
My sub-header |
| 24 |
------------- |
| 25 |
|
| 26 |
My second header |
| 27 |
================ |
| 28 |
|
| 29 |
My second sub-header |
| 30 |
-------------------- |
| 31 |
|
| 32 |
And here's a second-level header |
| 33 |
-------------------------------- |
| 34 |
|
| 35 |
Notice how it is nested *underneath* "Top-level header 2" in the TOC. |
| 36 |
|
| 37 |
|
| 38 |
An example with a single top-level header |
| 39 |
========================================= |
| 40 |
|
| 41 |
If the page only has a single top-level header, it |
| 42 |
is assumed to be the page title, and only the headers **underneath** the top-level |
| 43 |
header will be used for the right Table of Contents. |
| 44 |
|
| 45 |
On most pages in this documentation, only a single top-level header is used. For |
| 46 |
example, they have a page structure like: |
| 47 |
|
| 48 |
.. code-block:: rst |
| 49 |
|
| 50 |
My title |
| 51 |
======== |
| 52 |
|
| 53 |
My header |
| 54 |
--------- |
| 55 |
|
| 56 |
My second header |
| 57 |
---------------- |
| 58 |
|
| 59 |
|
| 60 |
.. meta:: |
| 61 |
:description lang=en: |
| 62 |
Examples of multiple headers in pydata-sphinx-theme. |