Skip to content

Commit 2915b5e

Browse files
committed
Revise and expand User Guides documentation
1 parent 3085d03 commit 2915b5e

1 file changed

Lines changed: 149 additions & 56 deletions

File tree

user_guide/08-user-guides.qmd

Lines changed: 149 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,39 @@ tags: [Content]
66

77
# User Guides
88

9-
Beyond API reference documentation, you often need narrative documentation: tutorials, guides, and explanations. Great Docs makes this easy with automatic User Guide support.
9+
API reference pages are valuable, but they only describe individual functions and classes in
10+
isolation. For users to truly understand your project, they need narrative documentation:
11+
tutorials that walk them through real tasks, guides that explain concepts in context, and
12+
explanations that connect the pieces together. Without this kind of content, users are left to
13+
figure out the bigger picture on their own.
14+
15+
Great Docs treats user guides as first-class content. When you add a `user_guide/` directory to
16+
your project, Great Docs automatically generates sidebar navigation, adds a navbar link, applies
17+
narrative-optimized styling, and keeps everything in sync across builds. You write Quarto Markdown
18+
files and Great Docs handles the rest.
1019

1120
## Creating a User Guide
1221

13-
To add a User Guide to your documentation:
22+
Getting started takes just three steps:
23+
24+
1. create a `user_guide/` directory in your project root
25+
2. add `.qmd` files for each page
26+
3. run `great-docs build`
1427

15-
1. Create a `user_guide/` directory in your project root
16-
2. Add `.qmd` files for each page
17-
3. Run `great-docs build`
28+
Great Docs automatically:
1829

19-
That's it! Great Docs automatically:
30+
- copies files to `great-docs/user-guide/`
31+
- generates sidebar navigation
32+
- adds a "User Guide" link to the navbar
33+
- organizes pages into sections
2034

21-
- Copies files to `great-docs/user-guide/`
22-
- Generates sidebar navigation
23-
- Adds a "User Guide" link to the navbar
24-
- Organizes pages into sections
35+
No additional configuration is required. As soon as Great Docs finds `.qmd` files in the
36+
`user_guide/` directory, the User Guide section appears in your site.
2537

2638
## Directory Structure
2739

40+
A typical project with a User Guide looks like this:
41+
2842
```{.default filename="Project structure"}
2943
your-project/
3044
├── great-docs/ # Build directory (ephemeral, gitignored)
@@ -42,11 +56,14 @@ your-project/
4256
└── your_package/
4357
```
4458

45-
The `user_guide/` directory is the default location. You can use a [custom directory](#custom-user-guide-directory) by setting `user_guide` in `great-docs.yml`.
59+
The `user_guide/` directory is the default location. You can use a
60+
[custom directory](#custom-user-guide-directory) by setting `user_guide` in `great-docs.yml`.
4661

4762
## Page Ordering
4863

49-
Files are sorted alphabetically by filename. Use numeric prefixes to control order:
64+
The order of pages in the sidebar matters for guiding readers through your content in a logical
65+
sequence. Files are sorted alphabetically by filename, so numeric prefixes give you full control
66+
over the ordering:
5067

5168
```{.default filename="user_guide/"}
5269
user_guide/
@@ -56,11 +73,17 @@ user_guide/
5673
└── 03-advanced.qmd # Fourth
5774
```
5875

59-
The prefix is stripped from the title, so `01-installation.qmd` becomes "Installation" in the navigation.
76+
The prefix is stripped from the title, so `01-installation.qmd` becomes "Installation" in the
77+
navigation. This means you can reorder pages at any time by renaming files without affecting how
78+
titles appear in the sidebar.
6079

6180
## Organizing into Sections
6281

63-
Group related pages into sections using the `guide-section` frontmatter key:
82+
As your user guide grows, flat lists of pages become hard to navigate. Sections let you group
83+
related pages together so readers can find what they need and understand how topics relate to each
84+
other.
85+
86+
The simplest approach is the `guide-section` frontmatter key:
6487

6588
```{.yaml filename="01-installation.qmd"}
6689
---
@@ -83,9 +106,13 @@ User Guide
83106
└── Customization
84107
```
85108

109+
This grouping is purely visual in the sidebar. The pages themselves remain as flat files in the
110+
`user_guide/` directory.
111+
86112
### Section Order
87113

88-
Sections appear in the order they're first encountered (based on file sort order). To control section order, ensure the first file in each section has the appropriate prefix:
114+
Sections appear in the order they're first encountered (based on file sort order). To control
115+
section order, ensure the first file in each section has the appropriate prefix:
89116

90117
```{.default filename="user_guide/"}
91118
user_guide/
@@ -98,7 +125,10 @@ user_guide/
98125

99126
### Subdirectory-Based Sections
100127

101-
As an alternative to `guide-section` frontmatter, you can organize pages into subdirectories. Each subdirectory becomes a section in the sidebar, with the section title derived from the subdirectory's `index.qmd` title (or the directory name if there is no `index.qmd`):
128+
For larger user guides, you may prefer organizing pages into actual subdirectories rather than using
129+
frontmatter. Each
130+
subdirectory becomes a section in the sidebar, with the section title derived from the
131+
subdirectory's `index.qmd` title (or the directory name if there is no `index.qmd`):
102132

103133
```{.default filename="user_guide/"}
104134
user_guide/
@@ -126,9 +156,13 @@ User Guide
126156
└── Deployment
127157
```
128158

129-
A root-level `index.qmd` is recommended so the "User Guide" navbar link has a landing page. Subdirectory `index.qmd` files provide section titles but don't appear as separate pages in the sidebar. Rather, their title is used as the collapsible section heading.
159+
A root-level `index.qmd` is recommended so the "User Guide" navbar link has a landing page.
160+
Subdirectory `index.qmd` files provide section titles but don't appear as separate pages in the
161+
sidebar. Rather, their title is used as the collapsible section heading.
130162

131-
Subdirectories are sorted alphabetically by directory name. To control the order of sections and pages within them, use numeric prefixes. They are stripped from both directory names and filenames in URLs and navigation:
163+
Subdirectories are sorted alphabetically by directory name. To control the order of sections and
164+
pages within them, use numeric prefixes. They are stripped from both directory names and filenames
165+
in URLs and navigation:
132166

133167
```{.default filename="user_guide/"}
134168
user_guide/
@@ -154,15 +188,21 @@ The prefixes control ordering but don't appear in the output:
154188

155189
This pattern gives you full control over section and page order while keeping URLs clean.
156190

157-
The subdirectory approach works well for larger user guides where the directory structure itself communicates the organization, while `guide-section` frontmatter is better suited for flat file layouts.
191+
The subdirectory approach works well for larger user guides where the directory structure itself
192+
communicates the organization, while `guide-section` frontmatter is better suited for flat file
193+
layouts.
158194

159195
## Writing Pages
160196

161-
User Guide pages are standard Quarto Markdown files, which means you have access to all of Quarto's powerful features for creating rich, interactive documentation. Here are some of the most useful features for writing guides.
197+
User Guide pages are standard Quarto Markdown files, which means you have access to all of Quarto's
198+
powerful features for creating rich, interactive documentation. Here are some of the most useful
199+
features for writing guides.
162200

163201
### Basic Frontmatter
164202

165-
Every User Guide page needs frontmatter at the top to define its title and section. The `title` appears in the sidebar navigation and as the page heading, while `guide-section` determines which group the page belongs to:
203+
Every User Guide page needs frontmatter at the top to define its title and section. The `title`
204+
appears in the sidebar navigation and as the page heading, while `guide-section` determines which
205+
group the page belongs to:
166206

167207
```{.yaml filename="your-page.qmd"}
168208
---
@@ -173,7 +213,8 @@ guide-section: "Section Name"
173213

174214
### Code Blocks
175215

176-
Code blocks with syntax highlighting are essential for technical documentation. Specify the language after the opening backticks to enable highlighting:
216+
Code blocks with syntax highlighting are essential for technical documentation. Specify the language
217+
after the opening backticks to enable highlighting:
177218

178219
````markdown
179220
```python
@@ -184,19 +225,23 @@ docs.build()
184225
```
185226
````
186227

187-
Quarto supports syntax highlighting for dozens of languages including Python, JavaScript, TypeScript, R, Bash, YAML, TOML, and many more.
228+
Quarto supports syntax highlighting for dozens of languages including Python, JavaScript,
229+
TypeScript, R, Bash, YAML, TOML, and many more.
188230

189-
For Python code that you want to actually execute and show the output, use `{python}` instead of just `python`. You can control execution behavior with hash-pipe options at the top of the code block. Some useful hash-pipe options include:
231+
For Python code that you want to actually execute and show the output, use `{python}` instead of
232+
just `python`. You can control execution behavior with hash-pipe options at the top of the code
233+
block. Some useful hash-pipe options include:
190234

191-
- `#| echo: false` – Hide the code, show only output
192-
- `#| eval: false` – Show the code but don't run it
193-
- `#| output: false` – Run the code but hide output
194-
- `#| warning: false` – Suppress warning messages
195-
- `#| fig-cap: "Caption"` – Add a caption to figure output
235+
- `#| echo: false`: hide the code, show only output
236+
- `#| eval: false`: show the code but don't run it
237+
- `#| output: false`: run the code but hide output
238+
- `#| warning: false`: suppress warning messages
239+
- `#| fig-cap: "Caption"`: add a caption to figure output
196240

197241
### Tabsets
198242

199-
Tabsets let you present alternative content (like code in multiple languages or instructions for different platforms) without cluttering the page. Readers can click to switch between tabs:
243+
Tabsets let you present alternative content (like code in multiple languages or instructions for
244+
different platforms) without cluttering the page. Readers can click to switch between tabs:
200245

201246
````markdown
202247
::: {.panel-tabset}
@@ -216,11 +261,13 @@ console.log("Hello");
216261
:::
217262
````
218263

219-
This is particularly useful for showing installation commands for different operating systems or demonstrating concepts in multiple programming languages.
264+
This is particularly useful for showing installation commands for different operating systems or
265+
demonstrating concepts in multiple programming languages.
220266

221267
### Callouts
222268

223-
Callouts draw attention to important information. Use them sparingly to highlight notes, warnings, or tips that readers shouldn't miss:
269+
Callouts draw attention to important information. Use them sparingly to highlight notes, warnings,
270+
or tips that readers shouldn't miss:
224271

225272
```markdown
226273
::: {.callout-note}
@@ -236,11 +283,13 @@ This is a tip.
236283
:::
237284
```
238285

239-
Each callout type has distinct styling. Notes are informational, warnings alert readers to potential issues, and tips offer helpful suggestions.
286+
Each callout type has distinct styling. Notes are informational, warnings alert readers to potential
287+
issues, and tips offer helpful suggestions.
240288

241289
### Images
242290

243-
Visual content like screenshots, diagrams, and architecture charts can greatly improve documentation. Store images in a subdirectory to keep your User Guide organized:
291+
Visual content like screenshots, diagrams, and architecture charts can greatly improve
292+
documentation. Store images in a subdirectory to keep your User Guide organized:
244293

245294
```{.default filename="user_guide/"}
246295
user_guide/
@@ -249,15 +298,17 @@ user_guide/
249298
└── screenshot.png
250299
```
251300

252-
Reference them in your content using standard Markdown image syntax. The alt text in brackets improves accessibility:
301+
Reference them in your content using standard Markdown image syntax. The alt text in brackets
302+
improves accessibility:
253303

254304
```markdown
255305
![Screenshot](images/screenshot.png)
256306
```
257307

258308
### Cross-References
259309

260-
Link freely between pages to help readers navigate related content. For other User Guide pages, use relative paths:
310+
Link freely between pages to help readers navigate related content. For other User Guide pages, use
311+
relative paths:
261312

262313
```markdown
263314
See the [Installation](installation.qmd) guide for details.
@@ -273,7 +324,8 @@ These links are validated during the build, so you'll catch broken references ea
273324

274325
## Asset Directories
275326

276-
Subdirectories that don't contain `.qmd` files are treated as asset directories and copied as-is:
327+
User guide pages often need supporting files like images, diagrams, or sample data. Any
328+
subdirectory that doesn't contain `.qmd` files is treated as an asset directory and copied as-is:
277329

278330
```{.default filename="user_guide/"}
279331
user_guide/
@@ -285,29 +337,51 @@ user_guide/
285337
└── example.json
286338
```
287339

340+
This means you can reference images and other files using simple relative paths (e.g.,
341+
`images/screenshot.png`) in your `.qmd` files, and Great Docs will make sure those files are
342+
available in the built site.
343+
288344
## User Guide Styling
289345

290-
Great Docs applies different styling to User Guide pages compared to API reference pages, optimizing for the narrative documentation experience. The sidebar filter that helps navigate large APIs is hidden since user guides are typically smaller and have a clear hierarchical structure. Breadcrumb navigation is also removed to provide a cleaner reading experience. The sidebar itself uses section-based navigation that mirrors your `guide-section` organization, making it easy for readers to see where they are in the documentation.
346+
Because user guides serve a different purpose than API references, Great Docs applies different
347+
styling to match. The sidebar filter that helps navigate large API listings is hidden since user
348+
guides are typically smaller and have a clear hierarchical structure. Breadcrumb navigation is also
349+
removed to provide a cleaner reading experience. The sidebar itself uses section-based navigation
350+
that mirrors your `guide-section` organization, making it easy for readers to see where they are
351+
in the guide.
352+
353+
These styling differences are applied automatically. You don't need to configure anything to get
354+
the narrative-optimized layout.
291355

292356
## Example: This User Guide
293357

294-
The Great Docs User Guide you're reading uses this exact structure:
358+
The User Guide you're reading right now is built with Great Docs, using the same features described
359+
on this page. Here's a representative sample of its structure:
295360

296-
```
361+
```{.default filename="user_guide/"}
297362
user_guide/
298-
├── 00-introduction.qmd # Getting Started
299-
├── 01-installation.qmd # Getting Started
300-
├── 02-quickstart.qmd # Getting Started
301-
├── 03-configuration.qmd # Core Concepts
302-
├── 04-api-documentation.qmd # Core Concepts
303-
├── 05-cli-documentation.qmd # Core Concepts
304-
├── 06-user-guides.qmd # Core Concepts
305-
└── 07-deployment.qmd # Deployment
363+
├── 00-introduction.qmd # Getting Started
364+
├── 01-installation.qmd # Getting Started
365+
├── 02-quickstart.qmd # Getting Started
366+
├── 03-authoring-qmd-files.qmd # Getting Started
367+
├── 04-writing-docstrings.qmd # Getting Started
368+
├── 05-configuration.qmd # Config & Theming
369+
├── 06-api-documentation.qmd # Site Content
370+
├── 07-cli-documentation.qmd # Site Content
371+
├── 08-user-guides.qmd # Site Content (this page)
372+
├── ... # 26 more pages
373+
└── 35-keyboard-keys.qmd # Site Content
306374
```
307375

376+
The guide spans 36 pages organized across five sections: Getting Started, Config & Theming, Site
377+
Content, Build & Deploy, and Quality & Maintenance. Numeric prefixes control page order, and
378+
`guide-section` frontmatter handles the grouping.
379+
308380
## Custom User Guide Directory
309381

310-
By default, Great Docs looks for a `user_guide/` directory in your project root. If you need your User Guide source files in a different location (e.g., inside a `docs/` folder or a monorepo subdirectory), you can specify a custom path in `great-docs.yml`:
382+
By default, Great Docs looks for a `user_guide/` directory in your project root. If you need your
383+
User Guide source files in a different location (e.g., inside a `docs/` folder or a monorepo
384+
subdirectory), you can specify a custom path in `great-docs.yml`:
311385

312386
```{.yaml filename="great-docs.yml"}
313387
user_guide: docs/guides
@@ -321,10 +395,13 @@ user_guide: content/user-docs
321395

322396
### Precedence Rules
323397

324-
If both a `user_guide` config option **and** a conventional `user_guide/` directory exist, the config option takes precedence and the `user_guide/` directory is ignored. Great Docs will print a warning to let you know:
398+
If both a `user_guide` config option **and** a conventional `user_guide/` directory exist, the
399+
config option takes precedence and the `user_guide/` directory is ignored. Great Docs will print a
400+
warning to let you know:
325401

326402
```
327-
⚠️ Both 'user_guide' config option ('docs/guides') and 'user_guide/' directory exist; using configured path
403+
⚠️ Both 'user_guide' config option ('docs/guides') and 'user_guide/' directory exist; using
404+
configured path
328405
```
329406

330407
### Warnings
@@ -339,9 +416,12 @@ In all three cases, the User Guide is skipped and processing continues normally.
339416

340417
## Tips
341418

419+
These tips cover common patterns and best practices for maintaining user guides as they grow.
420+
342421
### Keep Source Separate from Output
343422

344-
Whether you use the default `user_guide/` directory or a custom path, Great Docs copies files to `great-docs/user-guide/` during each build, keeping your source separate from generated output.
423+
Whether you use the default `user_guide/` directory or a custom path, Great Docs copies files to
424+
`great-docs/user-guide/` during each build, keeping your source separate from generated output.
345425

346426
### Use Descriptive Titles
347427

@@ -356,10 +436,23 @@ guide-section: "Reference"
356436

357437
### Organize Logically
358438

359-
Group related content into sections that make sense for your users. A common pattern starts with "Getting Started" content that covers installation and quick start guides. This is everything new users need to get up and running. "Core Concepts" sections explain the main features and typical usage patterns. "Advanced" sections dive into complex topics and customization options for power users. Finally, a "Reference" section can house configuration options and troubleshooting guides. Adapt this structure to fit your project's needs.
439+
Group related content into sections that make sense for your users. A common pattern starts with
440+
"Getting Started" content that covers installation and quick start guides. This is everything new
441+
users need to get up and running. "Core Concepts" sections explain the main features and typical
442+
usage patterns. "Advanced" sections dive into complex topics and customization options for power
443+
users. Finally, a "Reference" section can house configuration options and troubleshooting guides.
444+
Adapt this structure to fit your project's needs.
360445

361446
## Next Steps
362447

363-
User guides give your documentation the narrative depth that API references alone can't provide. With numbered files, frontmatter sections, and automatic sidebar generation, you can build a structured guide that grows alongside your project.
364-
365-
- [Deployment](deployment.qmd) covers publishing your documentation to GitHub Pages
448+
User guides bring the narrative depth that API references alone can't provide. With numbered files,
449+
frontmatter sections, and automatic sidebar generation, you can build a structured guide that
450+
grows alongside your project.
451+
452+
- [Custom Sections](custom-sections.qmd) explains how to add entirely new sidebar sections beyond
453+
the User Guide and API reference
454+
- [Cross-Referencing](cross-referencing.qmd) covers linking between User Guide pages and API
455+
reference pages
456+
- [Theming](theming.qmd) lets you customize the look and feel of your entire site, including User
457+
Guide pages
458+
- [Deployment](deployment.qmd) covers publishing your finished documentation to GitHub Pages

0 commit comments

Comments
 (0)