Skip to content

Commit 3a83653

Browse files
chore: Add Templates for tutorials and how-to docs following diataxis methodology (#713)
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Add templates for tutorials and how-tos. --------- Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
1 parent c863ca9 commit 3a83653

File tree

5 files changed

+406
-16
lines changed

5 files changed

+406
-16
lines changed

.github/config/wordlist.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,3 +453,6 @@ monorepo
453453
repos
454454
callout
455455
diataxis
456+
callouts
457+
shortcode
458+
shortcodes

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ All content lives under the `content` directory and is organized by section.
2727
| `content/_index.md` | Site landing page content |
2828
| `content/docs/concepts` | Concept explanations |
2929
| `content/docs/getting-started` | Getting Started guides |
30+
| `content/docs/how-to` | Task-focused how-to guides |
3031
| `content/docs/overview` | Overview and introductory information |
3132
| `content/docs/reference` | Reference and CLI documentation (mounted via module imports) |
32-
| `content/docs/tutorials` | Tutorials |
33+
| `content/docs/tutorials` | Step-by-step tutorials |
3334
| `content/community` | Community information |
3435

3536
Versioned snapshot folders live under `content_versioned/`:
@@ -58,7 +59,15 @@ logo: "📄"
5859
weight: 92
5960
```
6061
61-
There are templates for frontmatter of [standard pages](content_templates/new-doc.md) and [_index.md](content_templates/_index.md) of overview pages.
62+
### Documentation Templates
63+
64+
We follow the **Diataxis** documentation framework to structure our content. The following templates are available in `content_templates/`:
65+
66+
- [**Tutorial Template**](content_templates/template-tutorial.md) – For learning-oriented, step-by-step guides
67+
- [**How-To Guide Template**](content_templates/template-how-to.md) – For task-focused, goal-oriented instructions
68+
- [**Section Overview Template**](content_templates/_index.md) – For section `_index.md` files
69+
70+
Use these templates when creating new documentation to ensure consistency and best practices.
6271

6372
### Standard Content Pages
6473

content_templates/new-doc.md

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
title: "TEMPLATE: How-to Title"
3+
description: "A task-focused recipe: do X in OCM."
4+
weight: 999
5+
toc: true
6+
---
7+
8+
## Goal
9+
10+
One sentence: what you will achieve.
11+
12+
{{< callout type="note" >}}
13+
**You will end up with**
14+
15+
- A concrete outcome (artifact/config/state)
16+
- A verifiable success condition
17+
{{< /callout >}}
18+
19+
**Estimated time:** ~X minutes
20+
21+
## Prerequisites
22+
23+
- [OCM CLI]({{< relref "docs/getting-started/install.md" >}}) installed
24+
- Access to the required repository/service
25+
- Required credentials/keys available
26+
27+
{{< callout type="warning" >}}
28+
⚠️ **Preconditions:** Mention anything that would cause data loss or unexpected changes.
29+
{{< /callout >}}
30+
31+
## Steps
32+
33+
1. **Do the first thing**
34+
35+
Brief explanation (1–2 sentences max). Link to concepts for "why"—don't explain inline.
36+
37+
```bash
38+
ocm <command> <args>
39+
```
40+
41+
You should see: `[specific success indicator]`.
42+
43+
<details>
44+
<summary>Output</summary>
45+
46+
```text
47+
...
48+
```
49+
</details>
50+
51+
2. **Do the next thing**
52+
53+
If needed, show the minimal config:
54+
55+
```yaml
56+
# Key fields only
57+
key: value
58+
required: field
59+
```
60+
61+
3. **Verify**
62+
63+
Show the shortest check that proves success:
64+
65+
```bash
66+
ocm <command> --check
67+
```
68+
69+
You should see: `[expected output]`. This confirms your setup is correct.
70+
71+
<details>
72+
<summary>Expected output</summary>
73+
74+
```text
75+
OK ...
76+
```
77+
</details>
78+
79+
## Troubleshooting
80+
81+
### Symptom: [Specific error message]
82+
83+
**Cause:** One sentence explaining why.
84+
85+
**Fix:**
86+
87+
```bash
88+
# Fix command
89+
...
90+
```
91+
92+
### Symptom: [Another issue]
93+
94+
**Cause:** ...
95+
96+
**Fix:** ...
97+
98+
### Getting help
99+
100+
If these solutions don't work:
101+
102+
- [OCM Troubleshooting Guide]({{< relref "docs/troubleshooting/_index.md" >}})
103+
- [Community Support](link)
104+
- [Open an Issue](https://github.com/open-component-model/ocm/issues)
105+
106+
## Cleanup (optional)
107+
108+
Remove resources created:
109+
110+
```bash
111+
# Cleanup commands
112+
...
113+
```
114+
115+
{{< callout type="warning" >}}
116+
⚠️ This will delete [what will be deleted].
117+
{{< /callout >}}
118+
119+
## Next steps
120+
121+
- [Concept: Relevant Concept]({{< relref "docs/concepts/<file>.md" >}}) — understand why
122+
- [Tutorial: Related Tutorial]({{< relref "docs/tutorials/<file>.md" >}}) — learn by doing
123+
- [Reference: Command Docs]({{< relref "docs/reference/<file>.md" >}}) — complete details
124+
125+
## Related documentation
126+
127+
- [Concept: <name>]({{< relref "docs/concepts/<file>.md" >}})
128+
- [Tutorial: <name>]({{< relref "docs/tutorials/<file>.md" >}})
129+
- [Reference: <command>]({{< relref "docs/reference/<file>.md" >}})
130+
131+
---
132+
133+
## ✓ Before publishing
134+
135+
- [ ] Action verb title (Configure/Deploy/Create)
136+
- [ ] Simple numbered lists (use `{{< steps >}}` only if 5+ complex steps)
137+
- [ ] Success indicators after each step
138+
- [ ] Links to concepts (never inline "why" explanations)
139+
- [ ] Use `{{< tabs >}}` for variants (different approaches, platforms, configurations)
140+
- [ ] Troubleshooting with symptom-cause-fix
141+
- [ ] Working relref links
142+
- [ ] Realistic time estimate

0 commit comments

Comments
 (0)