Docusaurus documentation following Diataxis framework.
cd docs && npm install # Install deps
cd docs && npm start # Dev server at localhost:3000
cd docs && npm run build # Build static site
cd docs && npm test # Run sidebar utility tests
uv run invoke docs # Build documentation website
uv run invoke docs-generate # Regenerate all docs (infrahubctl CLI + Python SDK)
uv run invoke docs-validate # Check that generated docs match committed filesdocs/docs/
βββ python-sdk/
β βββ guides/ # How-to guides (task-oriented)
β βββ topics/ # Explanations (concept-oriented)
β βββ reference/ # API reference (auto-generated)
βββ infrahubctl/ # CLI docs (auto-generated)
Sidebar navigation is dynamic: sidebars-*.ts files read the filesystem at build time via utility functions in sidebar-utils.ts.
- infrahubctl: all
.mdxfiles are discovered automatically and sorted alphabetically. - python-sdk: guides, topics, and reference sections preserve a defined display order; new files are appended alphabetically at the end.
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.
- Create MDX file in appropriate directory
- Add frontmatter with
title
Use Tabs for async/sync examples, callouts for notes:
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs>
<TabItem value="async" label="Async">...</TabItem>
<TabItem value="sync" label="Sync">...</TabItem>
</Tabs>
:::warning
Use callouts for important notes.
:::β Always
- Include both async/sync examples using Tabs
- Run
uv run invoke docs-validateafter code changes to verify generated docs are up to date
π« Never
- Edit
docs/infrahubctl/*.mdxdirectly (regenerate withuv run invoke docs-generate) - Edit
docs/python-sdk/reference/config.mdxdirectly (regenerate withuv run invoke docs-generate) - Edit
docs/python-sdk/reference/templating.mdxdirectly (regenerate withuv run invoke docs-generate) - Edit
docs/python-sdk/sdk_ref/**/*.mdxdirectly (regenerate withuv run invoke docs-generate)