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
Copy file name to clipboardExpand all lines: docs/AGENTS.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,10 @@ Docusaurus documentation following Diataxis framework.
8
8
cd docs && npm install # Install deps
9
9
cd docs && npm start # Dev server at localhost:3000
10
10
cd docs && npm run build # Build static site
11
-
uv run invoke docs # Generate auto-docs
12
-
uv run invoke docs-validate # Validate docs are current
11
+
cd docs && npm test# Run sidebar utility tests
12
+
uv run invoke docs # Build documentation website
13
+
uv run invoke docs-generate # Regenerate all docs (infrahubctl CLI + Python SDK)
14
+
uv run invoke docs-validate # Check that generated docs match committed files
13
15
```
14
16
15
17
## Structure
@@ -23,11 +25,19 @@ docs/docs/
23
25
└── infrahubctl/ # CLI docs (auto-generated)
24
26
```
25
27
28
+
## Sidebars
29
+
30
+
Sidebar navigation is dynamic: `sidebars-*.ts` files read the filesystem at build time via utility functions in `sidebar-utils.ts`.
31
+
32
+
-**infrahubctl**: all `.mdx` files are discovered automatically and sorted alphabetically.
33
+
-**python-sdk**: guides, topics, and reference sections preserve a defined display order; new files are appended alphabetically at the end.
34
+
35
+
No manual sidebar update is needed when adding a new `.mdx` file. However, to control the display order of a new page, add its doc ID to the ordered list in the corresponding `sidebars-*.ts` file.
36
+
26
37
## Adding Documentation
27
38
28
39
1. Create MDX file in appropriate directory
29
40
2. Add frontmatter with `title`
30
-
3. Update `sidebars-*.ts` for navigation
31
41
32
42
## MDX Pattern
33
43
@@ -52,7 +62,7 @@ Use callouts for important notes.
52
62
✅ **Always**
53
63
54
64
- Include both async/sync examples using Tabs
55
-
- Run `uv run invoke docs-validate` after code changes
65
+
- Run `uv run invoke docs-validate` after code changes to verify generated docs are up to date
0 commit comments