You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ The value of the `root` key will be a path to a file, in Unix format (folders sp
39
39
This root file will be set as the [`master_doc`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-master_doc).
40
40
:::
41
41
42
-
Document files can then have a `parts` key - denoting a list of individual toctrees for that document - and in-turn each part should have a `sections` key - denoting a list of children links, that are one of: `file`, `url` or `glob`:
42
+
Document files can then have a `subtrees` key - denoting a list of individual toctrees for that document - and in-turn each subtree should have a `sections` key - denoting a list of children links, that are one of: `file`, `url` or `glob`:
43
43
44
44
- `file`: path to a single document file in Unix format, with or without the file extension (as for `root`)
45
45
- `glob`: path to one or more document files *via* Unix shell-style wildcards (similar to [`fnmatch`](https://docs.python.org/3/library/fnmatch.html), but single stars don't match slashes.)
@@ -53,13 +53,13 @@ This can proceed recursively to any depth.
53
53
54
54
```yaml
55
55
root: intro
56
-
parts:
56
+
subtrees:
57
57
- sections:
58
58
- file: doc1
59
-
parts:
59
+
subtrees:
60
60
- sections:
61
61
- file: doc2
62
-
parts:
62
+
subtrees:
63
63
- sections:
64
64
- file: doc3
65
65
- url: https://example.com
@@ -69,7 +69,7 @@ parts:
69
69
This is equivalent to having a single `toctree` directive in `intro`, containing `doc1`,
70
70
and a single `toctree` directive in `doc1`, with the `:glob:` flag and containing `doc2`, `https://example.com` and `subfolder/other*`.
71
71
72
-
As a shorthand, the `sections` key can be at the same level as the `file`, which denotes a document with a single `part`.
72
+
As a shorthand, the `sections` key can be at the same level as the `file`, which denotes a document with a single subtree.
73
73
For example, this file is exactly equivalent to the one above:
74
74
75
75
```yaml
@@ -91,54 +91,54 @@ With the `title` key you can set an alternative title for a document. and also f
91
91
92
92
```yaml
93
93
root: intro
94
-
parts:
94
+
subtrees:
95
95
- sections:
96
96
- file: doc1
97
97
title: Document 1 Title
98
98
- url: https://example.com
99
99
title: Example URL Title
100
100
```
101
101
102
-
### ToC tree (part) options
102
+
### ToC tree options
103
103
104
-
Each part can be configured with a number of options (see also [sphinx `toctree` options](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree)):
104
+
Each subtree can be configured with a number of options (see also [sphinx `toctree` options](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree)):
105
105
106
-
- `caption` (string): A title for the whole the part, e.g. shown above the part in ToCs
106
+
- `caption` (string): A title for the whole the subtree, e.g. shown above the subtree in ToCs
107
107
- `hidden` (boolean): Whether to show the ToC within (inline of) the document (default `False`).
108
108
By default it is appended to the end of the document, but see also the `tableofcontents` directive for positioning of the ToC.
109
109
- `maxdepth` (integer): A maximum nesting depth to use when showing the ToC within the document.
110
-
- `numbered` (boolean or integer): Automatically add numbers to all documents within a part (default `False`).
111
-
If set to `True`, all sub-parts will also be numbered based on nesting (e.g. with `1.1` or `1.1.1`),
110
+
- `numbered` (boolean or integer): Automatically add numbers to all documents within a subtree (default `False`).
111
+
If set to `True`, all sub-trees will also be numbered based on nesting (e.g. with `1.1` or `1.1.1`),
112
112
or if set to an integer then the numbering will only be applied to that depth.
113
-
- `reversed` (boolean): If `True` then the entries in the part will be listed in reverse order.
113
+
- `reversed` (boolean): If `True` then the entries in the subtree will be listed in reverse order.
114
114
This can be useful when using `glob` sections.
115
115
- `titlesonly` (boolean): If `True` then only the first heading in the document will be shown in the ToC, not other headings of the same level.
116
116
117
-
These options can be set at the level of the part:
117
+
These options can be set at the level of the subtree:
118
118
119
119
```yaml
120
120
root: intro
121
-
parts:
122
-
- caption: Part Caption
121
+
subtrees:
122
+
- caption: Subtree Caption
123
123
hidden: False
124
124
maxdepth: 1
125
125
numbered: True
126
126
reversed: False
127
127
titlesonly: True
128
128
sections:
129
129
- file: doc1
130
-
parts:
130
+
subtrees:
131
131
- titlesonly: True
132
132
sections:
133
133
- file: doc2
134
134
```
135
135
136
-
or, if you are using the shorthand for a single part, set options under an `options` key:
136
+
or, if you are using the shorthand for a single subtree, set options under an `options` key:
137
137
138
138
```yaml
139
139
root: intro
140
140
options:
141
-
caption: Part Caption
141
+
caption: Subtree Caption
142
142
hidden: False
143
143
maxdepth: 1
144
144
numbered: True
@@ -152,14 +152,14 @@ sections:
152
152
- file: doc2
153
153
```
154
154
155
-
You can also use the top-level `defaults` key, to set default options for all parts:
155
+
You can also use the top-level `defaults` key, to set default options for all subtrees:
156
156
157
157
```yaml
158
158
root: intro
159
159
defaults:
160
160
titlesonly: True
161
161
options:
162
-
caption: Part Caption
162
+
caption: Subtree Caption
163
163
hidden: False
164
164
maxdepth: 1
165
165
numbered: True
@@ -171,17 +171,17 @@ sections:
171
171
```
172
172
173
173
:::{warning}
174
-
`numbered`should not generally be used as a default, since numbering cannot be changed by nested parts, and sphinx will log a warning.
174
+
`numbered`should not generally be used as a default, since numbering cannot be changed by nested subtrees, and sphinx will log a warning.
175
175
:::
176
176
177
177
:::{note}
178
-
By default, section numbering restarts for each `part`.
178
+
By default, section numbering restarts for each subtree.
179
179
If you want want this numbering to be continuous, check-out the [sphinx-multitoc-numbering extension](https://github.com/executablebooks/sphinx-multitoc-numbering).
180
180
:::
181
181
182
182
## Add a ToC to a page's content
183
183
184
-
By default, the `toctree` generated per document (one per `part`) are appended to the end of the document and hidden (then, for example, most HTML themes show them in a side-bar).
184
+
By default, the `toctree` generated per document (one per subtree) are appended to the end of the document and hidden (then, for example, most HTML themes show them in a side-bar).
185
185
But if you would like them to be visible at a certain place within the document body, you may do so by using the `tableofcontents` directive:
186
186
187
187
ReStructuredText:
@@ -199,7 +199,7 @@ MyST Markdown:
199
199
200
200
Currently, only one `tableofcontents` should be used per page (all `toctree` will be added here), and only if it is a page with child/descendant documents.
201
201
202
-
Note, this will override the `hidden` option set for a part.
202
+
Note, this will override the `hidden` option set for a subtree.
0 commit comments