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
+32-28Lines changed: 32 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ The value of the `root` key will be a path to a file, in Unix format (folders sp
43
43
This root file will be set as the [`master_doc`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-master_doc).
44
44
:::
45
45
46
-
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 `items` key - denoting a list of children links, that are one of:
46
+
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 `entries` key - denoting a list of children links, that are one of:
47
47
48
48
- `file`: path to a single document file in Unix format, with or without the file extension (as for `root`)
49
49
- `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.)
@@ -58,13 +58,13 @@ This can proceed recursively to any depth.
58
58
```yaml
59
59
root: intro
60
60
subtrees:
61
-
- items:
61
+
- entries:
62
62
- file: doc1
63
63
subtrees:
64
-
- items:
64
+
- entries:
65
65
- file: doc2
66
66
subtrees:
67
-
- items:
67
+
- entries:
68
68
- file: doc3
69
69
- url: https://example.com
70
70
- glob: subfolder/other*
@@ -73,16 +73,16 @@ subtrees:
73
73
This is equivalent to having a single `toctree` directive in `intro`, containing `doc1`,
74
74
and a single `toctree` directive in `doc1`, with the `:glob:` flag and containing `doc2`, `https://example.com` and `subfolder/other*`.
75
75
76
-
As a shorthand, the `items` key can be at the same level as the `file`, which denotes a document with a single subtree.
76
+
As a shorthand, the `entries` key can be at the same level as the `file`, which denotes a document with a single subtree.
77
77
For example, this file is exactly equivalent to the one above:
78
78
79
79
```yaml
80
80
root: intro
81
-
items:
81
+
entries:
82
82
- file: doc1
83
-
items:
83
+
entries:
84
84
- file: doc2
85
-
items:
85
+
entries:
86
86
- file: doc3
87
87
- url: https://example.com
88
88
- glob: subfolder/other*
@@ -96,7 +96,7 @@ With the `title` key you can set an alternative title for a document. and also f
96
96
```yaml
97
97
root: intro
98
98
subtrees:
99
-
- items:
99
+
- entries:
100
100
- file: doc1
101
101
title: Document 1 Title
102
102
- url: https://example.com
@@ -115,7 +115,7 @@ Each subtree can be configured with a number of options (see also [sphinx `toctr
115
115
If set to `True`, all sub-trees will also be numbered based on nesting (e.g. with `1.1` or `1.1.1`),
116
116
or if set to an integer then the numbering will only be applied to that depth.
117
117
- `reversed` (boolean): If `True` then the entries in the subtree will be listed in reverse order (default `False`).
118
-
This can be useful when using `glob` items.
118
+
This can be useful when using `glob` entries.
119
119
- `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 (default `False`).
120
120
121
121
These options can be set at the level of the subtree:
@@ -129,11 +129,11 @@ subtrees:
129
129
numbered: True
130
130
reversed: False
131
131
titlesonly: True
132
-
items:
132
+
entries:
133
133
- file: doc1
134
134
subtrees:
135
135
- titlesonly: True
136
-
items:
136
+
entries:
137
137
- file: doc2
138
138
```
139
139
@@ -148,11 +148,11 @@ options:
148
148
numbered: True
149
149
reversed: False
150
150
titlesonly: True
151
-
items:
151
+
entries:
152
152
- file: doc1
153
153
options:
154
154
titlesonly: True
155
-
items:
155
+
entries:
156
156
- file: doc2
157
157
```
158
158
@@ -168,9 +168,9 @@ options:
168
168
maxdepth: 1
169
169
numbered: True
170
170
reversed: False
171
-
items:
171
+
entries:
172
172
- file: doc1
173
-
items:
173
+
entries:
174
174
- file: doc2
175
175
```
176
176
@@ -185,18 +185,18 @@ If you want want this numbering to be continuous, check-out the [sphinx-multitoc
185
185
186
186
### Using different key-mappings
187
187
188
-
For certain use-cases, it is helpful to map the `subtrees`/`items` keys to mirror e.g. an output [LaTeX structure](https://www.overleaf.com/learn/latex/sections_and_chapters).
188
+
For certain use-cases, it is helpful to map the `subtrees`/`entries` keys to mirror e.g. an output [LaTeX structure](https://www.overleaf.com/learn/latex/sections_and_chapters).
189
189
190
190
The `format` key can be used to provide such mappings (and also initial defaults).
Note that, for performance, files that are in *hidden folders* (e.g. in `.tox` or `.venv`) will not be added to `exclude_patterns` even if they are not specified in the ToC.
267
267
You should exclude these folders explicitly.
268
268
269
+
:::{important}
270
+
This feature is not currently compatible with [orphan files](https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#metadata).
271
+
:::
272
+
269
273
## Command-line
270
274
271
275
This package comes with the `sphinx-etoc` command-line program, with some additional tools.
@@ -299,7 +303,7 @@ Note, you can also add additional files in `meta`/`create_files` amd append text
0 commit comments