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
Refactor documentation templates for consistency and clarity
- Standardize titles and sidebar labels across templates
- Update code block formatting for better readability
- Improve example structures and explanations
- Remove unnecessary markdown syntax for cleaner output
Copy file name to clipboardExpand all lines: docs/contributing/templates/how-to.mdx
+9-92Lines changed: 9 additions & 92 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
---
2
-
title: How-To Guide Template
2
+
title: How-To guide template
3
3
description: Template for creating task-oriented documentation.
4
-
sidebar_label: How-To Template
4
+
sidebar_label: How-To
5
5
---
6
6
7
-
# How-To Guide Template
7
+
# How-To guide template
8
8
9
9
Use this template for task-oriented documentation that helps users accomplish a specific goal.
10
10
@@ -17,7 +17,7 @@ Use a how-to guide when users:
17
17
- Want to complete a specific task
18
18
- Already understand basic concepts
19
19
20
-
**Examples:**
20
+
Examples:
21
21
22
22
- How to configure browser settings
23
23
- How to run tests in parallel
@@ -28,7 +28,7 @@ Use a how-to guide when users:
28
28
29
29
Copy and adapt this template for your how-to guide:
30
30
31
-
```markdown
31
+
````markdown
32
32
---
33
33
title: How to [accomplish task]
34
34
description: [One-sentence description of what users will accomplish]
@@ -52,7 +52,9 @@ description: [One-sentence description of what users will accomplish]
52
52
53
53
[Provide detailed instructions. Use numbered sub-steps if needed.]
54
54
55
-
\`\`\`[language] title="[filename if applicable]" [Code example or command] \`\`\`
55
+
```[language] title="[filename if applicable]"
56
+
[Code example or command]
57
+
```
56
58
57
59
[Explain what this code does or what to expect.]
58
60
@@ -93,7 +95,7 @@ description: [One-sentence description of what users will accomplish]
93
95
- [Related task 1](link)
94
96
- [Related task 2](link)
95
97
- [Learn more about X](link)
96
-
```
98
+
````
97
99
98
100
## Writing tips
99
101
@@ -156,91 +158,6 @@ Before submitting:
156
158
3. ✅ Test on a clean environment if possible
157
159
4. ✅ Note any assumptions or prerequisites
158
160
159
-
## Example how-to guide
160
-
161
-
Here's a complete example:
162
-
163
-
```markdown
164
-
---
165
-
title: How to run tests in parallel
166
-
description: Speed up test execution by running multiple tests simultaneously.
167
-
---
168
-
169
-
# How to run tests in parallel
170
-
171
-
Run multiple Doc Detective tests at the same time to reduce total execution time. This is useful when you have many tests or tests that take a long time to complete.
This runs up to 4 tests simultaneously. Adjust based on your system resources.
186
-
187
-
## Step 2: Run your tests
188
-
189
-
Execute tests as usual:
190
-
191
-
\`\`\`bash npx doc-detective runTests \`\`\`
192
-
193
-
Doc Detective automatically distributes tests across parallel workers.
194
-
195
-
## Step 3: Monitor execution
196
-
197
-
Watch the output to see parallel execution:
198
-
199
-
\`\`\` [INFO] Running tests with concurrency: 4 [INFO] Test 1: RUNNING [INFO] Test 2: RUNNING [INFO] Test 3: RUNNING [INFO] Test 4: RUNNING [INFO] Test 1: PASSED [INFO] Test 5: RUNNING \`\`\`
200
-
201
-
## Verify it works
202
-
203
-
Compare execution time with and without parallelization:
204
-
205
-
\`\`\`bash
206
-
207
-
# Without parallelization
208
-
209
-
time npx doc-detective runTests --concurrency 1
210
-
211
-
# With parallelization
212
-
213
-
time npx doc-detective runTests --concurrency 4 \`\`\`
214
-
215
-
You should see reduced execution time.
216
-
217
-
## Troubleshooting
218
-
219
-
### Tests fail in parallel but pass individually
220
-
221
-
**Cause:** Tests may have dependencies or shared state
222
-
223
-
**Solution:** Ensure tests are independent. Avoid:
224
-
225
-
- Shared files or resources
226
-
- Dependencies between tests
227
-
- Hardcoded ports or URLs
228
-
229
-
### System becomes unresponsive
230
-
231
-
**Cause:** Too many parallel tests for available resources
232
-
233
-
**Solution:** Reduce concurrency:
234
-
235
-
\`\`\`json { "concurrency": 2 } \`\`\`
236
-
237
-
## What's next
238
-
239
-
- [Optimize test performance](/docs/tutorials/optimize-tests)
240
-
- [Configure test contexts](/docs/get-started/config/contexts/)
0 commit comments