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
Add support for hidden files in documentation TOC (#381)
Hidden files can now be excluded from navigation and indexing but still linked directly if needed. Adjustments include handling hidden attributes in TOC parsing and ensuring related navigation logic respects these exclusions.
Copy file name to clipboardExpand all lines: docs/configure/content-set/navigation.md
+38-7Lines changed: 38 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,16 +73,19 @@ toc:
73
73
- file: index.md
74
74
```
75
75
76
-
The table of contents can be created independent of the directory structure of the files it defines. You can use directories to define nesting in the TOC, but you don't have to. For example, both of the following create the same nav structure:
76
+
The TOC in principle follows the directory structure on disk.
77
+
78
+
#### `folder:`
77
79
78
80
```yaml
79
81
...
80
-
- file: subsection/index.md
81
-
children:
82
-
- file: subsection/page-one.md
83
-
- file: subsection/page-two.md
82
+
- folder: subsection
84
83
```
85
84
85
+
If a folder does not explicitly define `children` all markdown files within that folder are included automatically
86
+
87
+
If a folder does define `children` all markdown files within that folder have to be included. `docs-builder` will error if it detects dangling documentation files.
88
+
86
89
```yaml
87
90
...
88
91
- folder: subsection
@@ -92,7 +95,33 @@ The table of contents can be created independent of the directory structure of t
92
95
- file: page-two.md
93
96
```
94
97
95
-
#### Nest `toc`
98
+
#### Virtual grouping
99
+
100
+
A `file` element may include children to create a virtual grouping that
101
+
does not match the directory structure.
102
+
103
+
```yaml
104
+
...
105
+
- file: subsection/index.md
106
+
children:
107
+
- file: subsection/page-one.md
108
+
- file: subsection/page-two.md
109
+
```
110
+
111
+
A `file` may only select siblings and more deeply nested files as its children. It may not select files outside its own subtree on disk.
112
+
113
+
#### Hidden files
114
+
115
+
A hidden file can be declared in the TOC.
116
+
```yaml
117
+
- hidden: developer-pages.md
118
+
```
119
+
120
+
It may not have any children and won't show up in the navigation.
121
+
122
+
It [may be linked to locally however](../../developer-notes.md)
123
+
124
+
#### Nesting `toc`
96
125
97
126
The `toc` key can include nested `toc.yml` files.
98
127
@@ -122,4 +151,6 @@ See [Attributes](./attributes.md) to learn more.
122
151
123
152
As a rule, each `docset.yml` file can only be included once in the assembler. This prevents us from accidentally duplicating pages in the docs. However, there are times when you want to split content sets and include them partially in different areas of the TOC. That's what `toc.yml` files are for. These files split one documentation set into multiple “sub-TOCs,” each mapped to a different navigation node.
124
153
125
-
All configuration options that `docset.yml` supports are supported by `toc.yml`.
154
+
A `toc.yml` file may only declare a nested [TOC](#toc), other options are ignored.
155
+
156
+
A `toc.yml` may not link to further nested `toc.yml` files. Doing so will result in an error
0 commit comments