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
generate the `sitemap.xml`. This is useful if you want to integrate with [Algolia and use its crawler](https://www.algolia.com/products/crawler/). You must include the protocol for this to work currently, e.g. `http://pixijs.webdoclabs.com`.
19
19
*`--site-root <path>`: If using absolute links in a template, this will set the basepath. The basepath should the directory in which the documentation is being stored relative to where the server is running. The site root is "/" by default - which means that you'll need to serve the documentation directory as top-level. Note that @webdoc/default-template uses absolute links.
20
20
*`-c <config-path>`: This sets the path of the configuration file webdoc uses.
21
+
*`-u <tutorials-directory>` - (optional) This should point to a directory containing tutorials written in Markdown (".md") or HTML ".html, ".htm". JSON files can be used to configure the hierarchy and naming of tutorials (see the Tutorial Configuration section).
21
22
22
23
### Configuration
23
24
@@ -90,21 +91,23 @@ The `template` object is used by the site template.
@@ -117,3 +120,107 @@ The `template` object is used by the site template.
117
120
*`template.integrations`: (optional) Integrations with 3rd party solutions in your template. This object is dependent on which template you're using. For @webdoc/default-template, the following integrations are available:
118
121
*`search`: This is used as the backend for the global site search. You'll need to create an Algolia account yourself and provide
119
122
the `apiKey`, `appId`, `indexName`. (The only supported provider is "algolia" right now)
123
+
124
+
### Tutorial configuration
125
+
126
+
Tutorials can be structured in a hierarchy using JSON files in the tutorials directory. If you have multiple JSON configuration, they
127
+
are deep-merged before being processed.
128
+
129
+
#### Per-tutorial configuration
130
+
131
+
Tutorials are referenced using their file name - so make sure all file names in the tutorial directory are unique. To configure a specific
132
+
tutorial file, any configuration should reference it by the file name (excluding the extension). For example, to configure "hello-world.md":
133
+
134
+
```json
135
+
{
136
+
"hello-world": {
137
+
"title": "Hello world! by webdoc"
138
+
}
139
+
}
140
+
```
141
+
142
+
*`title` - This is what the navigation sidebar will list the tutorial as.
143
+
144
+
#### Defining a hierarchy
145
+
146
+
You can also define children in tutorial configurators inline:
147
+
148
+
```json
149
+
{
150
+
"hello-world": {
151
+
"title": "Hello world! by webdoc",
152
+
"children": {
153
+
"chapter-1": {
154
+
"title": "Chapter 1"
155
+
},
156
+
"chapter-2": {
157
+
"title": "Chapter 2"
158
+
}
159
+
}
160
+
},
161
+
"next-steps": {
162
+
"title": "Next-steps"
163
+
}
164
+
}
165
+
```
166
+
167
+
In this configuration, "Chapter 1" and "Chapter 2" will be items under the "Hello world!" category.
168
+
169
+
#### Referencing other tutorials
170
+
171
+
Instead of defining tutorials inline in the `children` object, you can add them to the root and then reference
172
+
them by name in a `children` array.
173
+
174
+
```json
175
+
{
176
+
"hello-world": {
177
+
"title": "Hello world! by webdoc",
178
+
"children": [
179
+
"chapter-1",
180
+
"chapter-2"
181
+
]
182
+
},
183
+
"chapter-1": {
184
+
"title": "Chapter 1"
185
+
},
186
+
"chapter-2": {
187
+
"title": "Chapter 2"
188
+
},
189
+
"next-steps": {
190
+
"title": "Next-steps"
191
+
}
192
+
}
193
+
```
194
+
195
+
The above configuration is equivalent to the one defining "Chapter 1" and "Chapter 2" children inline "Hello world!". This way,
196
+
you can also split the configuration into multiple files:
0 commit comments