Skip to content

Commit 8bbf508

Browse files
authored
Add content templates (#2569)
* add templates * update supporting docs * update reference template
1 parent 89a7000 commit 8bbf508

File tree

4 files changed

+281
-1
lines changed

4 files changed

+281
-1
lines changed

docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@
270270
"pages": [
271271
"guides/accessibility",
272272
"guides/content-types",
273+
"guides/content-templates",
273274
"guides/improving-docs",
274275
"guides/maintenance",
275276
"guides/media",

guides/content-templates.mdx

Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
1+
---
2+
title: "Content templates"
3+
description: "Copy and modify these templates to quickly create documentation for different content types."
4+
keywords: ["templates"]
5+
---
6+
7+
Use these templates as starting points for creating documentation. Customize the templates for your documentation and your audience.
8+
9+
1. Copy the template that matches your content type.
10+
2. Replace placeholders and example content with your actual content.
11+
3. Adjust sections as needed.
12+
4. Remove any sections that don't apply.
13+
14+
<Tip>
15+
Not sure which template to use? Read about [content types](/guides/content-types) to understand when to use each one.
16+
</Tip>
17+
18+
## How-to guide template
19+
20+
Use how-to guides when users need to accomplish a specific task and already have some familiarity with your product. How-tos are goal-driven and get straight to the solution.
21+
22+
````mdx How-to guide template
23+
---
24+
title: "[Titles should start with a verb]"
25+
description: "[Do specific task] to [achieve outcome]."
26+
---
27+
28+
Start with a brief statement of what this guide helps users accomplish.
29+
30+
## Prerequisites (optional)
31+
32+
List only what's necessary:
33+
34+
- Required setup or configuration
35+
- Permissions needed
36+
- Related features that should be configured first
37+
38+
## [Action-oriented heading describing the task]
39+
40+
Provide direct instructions focused on achieving the goal.
41+
42+
1. Open [location] and navigate to [specific place]
43+
2. Click [button or option]
44+
3. Enter [required information]
45+
4. Click [confirmation button]
46+
47+
```language
48+
// Include code examples that users can copy and modify
49+
```
50+
51+
<Tip>
52+
Include practical tips that help users avoid common mistakes or work more efficiently.
53+
</Tip>
54+
55+
## Verify the result (optional)
56+
57+
If success is ambiguous, explain how users can confirm they completed the task successfully.
58+
59+
## Troubleshooting (optional)
60+
61+
Address common issues users might encounter:
62+
63+
- **Problem description**: Solution or workaround
64+
- **Another common issue**: How to resolve it
65+
66+
## Related tasks
67+
68+
Link to related how-to guides or next steps.
69+
````
70+
71+
## Tutorial template
72+
73+
Use tutorials when you want to help new users learn through hands-on practice. Tutorials guide users step-by-step through a complete learning experience with a clear outcome.
74+
75+
````mdx Tutorial template
76+
---
77+
title: "[Action verb] [specific outcome]"
78+
description: "Learn how to [specific outcome] by [method or approach]."
79+
---
80+
81+
Use an introduction paragraph to explain what users will learn and what they'll be able to do after completing this tutorial.
82+
83+
## Prerequisites
84+
85+
List what users need before starting:
86+
87+
- Required knowledge or skills
88+
- Tools, accounts, or permissions
89+
- Time commitment (optional)
90+
91+
## Step 1: [First action]
92+
93+
Provide clear, specific instructions for the first step.
94+
95+
```language
96+
// Include code examples where helpful
97+
```
98+
99+
Explain what this step accomplishes and why it matters.
100+
101+
## Step 2: [Second action]
102+
103+
Continue with sequential steps that build on previous work.
104+
105+
Point out milestones and progress markers so users know they're on track.
106+
107+
## Step 3: [Third action]
108+
109+
Keep steps focused on concrete actions rather than theory.
110+
111+
Minimize choices that users need to make.
112+
113+
## Next steps
114+
115+
Summarize what users learned and suggest logical next steps:
116+
117+
- Related tutorials to try
118+
- How-to guides for common tasks
119+
- Additional resources for deeper learning
120+
````
121+
122+
## Explanation template
123+
124+
Use explanations when users need to understand concepts, design decisions, or how complex features work. Explanations provide context and deepen understanding rather than giving step-by-step instructions.
125+
126+
````mdx Explanation template
127+
---
128+
title: "About [concept or feature]"
129+
description: "Understand [concept] and how it works within [product or context]."
130+
---
131+
132+
Start with a clear statement of what this explanation covers and why understanding it matters.
133+
134+
Define the concept in plain language. Explain what it is, what it does, and why it exists.
135+
136+
Use analogies or comparisons to familiar concepts when helpful.
137+
138+
## How [concept] works
139+
140+
Explain the underlying mechanics, architecture, or process.
141+
142+
<Frame>
143+
<img src="/path/to/diagram.png" alt="Diagram showing how [concept] works" />
144+
</Frame>
145+
146+
Break down complex ideas into digestible sections.
147+
148+
## Why [design decision or approach]
149+
150+
Provide context about why things work the way they do.
151+
152+
Discuss trade-offs, alternatives that were considered, or constraints that influenced the design.
153+
154+
## When to use [concept]
155+
156+
Help users understand when this concept or approach is most appropriate.
157+
158+
- **Use case 1**: When this approach makes sense
159+
- **Use case 2**: Another scenario where this is the right choice
160+
- **Not recommended for**: Situations where alternatives are better
161+
162+
## Relationship to other features
163+
164+
Draw connections to related concepts or features in your product.
165+
166+
Explain how this concept fits into the broader system or workflow.
167+
168+
## Common misconceptions
169+
170+
Address misunderstandings or clarify subtle distinctions.
171+
172+
## Further reading
173+
174+
Link to related explanations, tutorials, or reference documentation.
175+
````
176+
177+
## Reference template
178+
179+
Use reference documentation when users need to look up specific details about your product's functionality. Reference docs prioritize accuracy, consistency, and scannability.
180+
181+
````mdx Reference template
182+
---
183+
title: "[Feature or API name] reference"
184+
description: "Complete reference for [feature or API] properties, parameters, and options."
185+
---
186+
187+
Provide a one-sentence description of what this feature or API does.
188+
189+
## Properties
190+
191+
<ParamField body="property1" type="string" required>
192+
Brief description of the property.
193+
</ParamField>
194+
195+
<ParamField body="property2" type="number">
196+
Brief description with default value if applicable.
197+
</ParamField>
198+
199+
<ParamField body="property3" type="boolean" default="false">
200+
Brief description.
201+
</ParamField>
202+
203+
## Parameters
204+
205+
<ParamField body="parameterName" type="string">
206+
Description of what this parameter does and when to use it.
207+
208+
```language
209+
// Example showing typical usage
210+
```
211+
</ParamField>
212+
213+
<ParamField body="anotherParameter" type="object">
214+
Description of the parameter.
215+
216+
Available options:
217+
218+
- `option1`: Description of this option.
219+
- `option2`: Description of this option.
220+
</ParamField>
221+
222+
## Examples
223+
224+
### Basic example
225+
226+
```language title="Basic usage"
227+
// Minimal example showing common use case
228+
```
229+
230+
### Advanced example
231+
232+
```language title="Advanced configuration"
233+
// Example with multiple options configured
234+
```
235+
236+
## Response
237+
238+
If documenting an API, describe the response structure.
239+
240+
<ResponseField name="field1" type="string" required>
241+
Description of the response field.
242+
</ResponseField>
243+
244+
<ResponseField name="field2" type="number">
245+
Description of another response field.
246+
</ResponseField>
247+
248+
Example response:
249+
250+
```json
251+
{
252+
"field1": "value",
253+
"field2": 123
254+
}
255+
```
256+
257+
## Related references
258+
259+
Link to related reference documentation.
260+
````
261+
262+
## Related pages
263+
264+
<CardGroup cols={2}>
265+
<Card title="Content types" icon="shapes" href="/guides/content-types">
266+
Choose the right content type for your documentation goals.
267+
</Card>
268+
<Card title="Style and tone" icon="pen" href="/guides/style-and-tone">
269+
Write effective documentation with consistent style.
270+
</Card>
271+
<Card title="Format text" icon="text" href="/create/text">
272+
Learn how to format text and style content.
273+
</Card>
274+
</CardGroup>

guides/content-types.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,19 @@ Defining content types helps you plan documentation with a clear purpose and mak
7777

7878
## Tips and tricks
7979

80-
1. **Maintain purpose**: Before writing, assign each page a specific content type and make it top of mind in the doc throughout your writing.
80+
1. **Maintain purpose**: Before writing, assign each page a specific content type and make it top of mind in the doc throughout your writing.
8181
2. **Consider content freshness**: Regardless of content type, try to optimize for evergreen documentation. If something represents a moment in time of what a feature looks like on a specific date, it's probably better suited for a changelog or blog post than in your documentation. Or if something changes very frequently avoid putting it in your docs.
8282
3. **Think like your users**: Consider different user personas when organizing content. See [Understand your audience](/guides/understand-your-audience) for more information.
83+
4. **Use templates**: Start with [content templates](/guides/content-templates) that provide the basic structure for each content type.
8384

8485
While the Diátaxis framework provides a starting point, successful documentation requires contextual adaptation to your product. Start by understanding the framework's principles, then adjust them to serve your users' needs.
8586

8687
## Related pages
8788

8889
<CardGroup cols={2}>
90+
<Card title="Content templates" icon="file-code" href="/guides/content-templates">
91+
Copy and modify templates for each content type.
92+
</Card>
8993
<Card title="Style and tone" icon="pen" href="/guides/style-and-tone">
9094
Write effective documentation with consistent style.
9195
</Card>

guides/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Make your documentation best in class.
3030

3131
- [Accessibility](/guides/accessibility): Make your docs accessible to as many users as possible.
3232
- [Content types](/guides/content-types): Choose the right format for tutorials, how-tos, references, and explanations.
33+
- [Content templates](/guides/content-templates): Copy and modify templates for each content type.
3334
- [Improve your docs](/guides/improving-docs): Use data and feedback to continuously improve your documentation.
3435
- [Maintenance](/guides/maintenance): Keep your documentation accurate and up-to-date.
3536
- [Media](/guides/media): Add images, videos, and other media effectively while managing maintenance burden.

0 commit comments

Comments
 (0)