Skip to content

Commit 73f3c86

Browse files
authored
Update toc.rst
1 parent a535536 commit 73f3c86

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

docs/source/plugins/toc.rst

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,30 +89,38 @@ To create a table of contents:
8989
Positioning at Top of Page
9090
==========================
9191

92+
Table of contents at the top Example
93+
------------------------------------
94+
9295
Since the TOC must be placed after headings to collect them, use grid layouts to display it at the top:
9396

97+
1. Create a container
98+
2. Add a row with two columns
99+
3. In the first (bottom) column: Add your content with Heading plugins
100+
4. In the second (top) column: Add the TOC plugin
101+
5. Set the column width and order: Both columns should cover full width (typically 12/12),
102+
the second columns should be shown before (i.e., at the top) the first (then at the bottom)
103+
94104
Two Column Layout Example
95105
-------------------------
96106

97107
1. Create a container
98108
2. Add a row with two columns
99-
3. In the first (left) column:
100-
- Add the TOC plugin
101-
4. In the second (right) column:
102-
- Add your content with Heading plugins
109+
3. In the first (left) column: Add your content with Heading plugins
110+
4. In the second (right) column: Add the TOC plugin
103111
5. Set column widths appropriately (e.g., 3/9 split)
104112

105113
Example Structure::
106114

107115
Container
108116
└── Row
109-
├── Column (col-3)
110-
── TOC Plugin
111-
── Column (col-9)
112-
├── Heading Plugin
113-
── Content...
114-
── Heading Plugin
115-
└── More content...
117+
├── Column (col-9)
118+
── Heading Plugin
119+
│ ├── Content...
120+
├── Heading Plugin
121+
── More content...
122+
── Column (col-3)
123+
└── TOC Plugin
116124

117125
This creates a sidebar layout with the TOC always visible while scrolling through content.
118126

0 commit comments

Comments
 (0)