File: mult_headers.rst

package info (click to toggle)
pydata-sphinx-theme 0.16.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,088 kB
  • sloc: python: 2,796; javascript: 701; makefile: 42; sh: 12
file content (62 lines) | stat: -rw-r--r-- 1,587 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Top-level headers and the TOC
=============================

Your right table of contents will behave slightly differently depending on
whether your page has one top-level header, or multiple top-level headers. See
below for more information.

An example with multiple top-level headers
==========================================

If a page has multiple top-level headers on it, then the in-page Table of Contents
will show each top-level header.
**On this page, there are multiple top-level headers**. As a result, the top-level
headers all appear in the right Table of Contents. Here's an example of a page structure
with multiple top-level headers:


.. code-block:: rst

   My first header
   ===============

   My sub-header
   -------------

   My second header
   ================

   My second sub-header
   --------------------

And here's a second-level header
--------------------------------

Notice how it is nested *underneath* "Top-level header 2" in the TOC.


An example with a single top-level header
=========================================

If the page only has a single top-level header, it
is assumed to be the page title, and only the headers **underneath** the top-level
header will be used for the right Table of Contents.

On most pages in this documentation, only a single top-level header is used. For
example, they have a page structure like:

.. code-block:: rst

   My title
   ========

   My header
   ---------

   My second header
   ----------------


.. meta::
    :description lang=en:
        Examples of multiple headers in pydata-sphinx-theme.