Skip to content

Commit 3e45fa9

Browse files
authored
📝 docs: restructure following Diataxis framework (#448)
The documentation previously mixed learning material, task recipes, background explanations, and API reference in the same files. A new user trying to get started would land in `usage.rst` alongside advanced platform conventions and real-world project examples, making it hard to follow a clear learning path. Similarly, someone looking for a quick recipe had to skim past explanatory prose to find the code they needed. This restructures the docs into the four quadrants of the [Diataxis framework](https://diataxis.fr/): a step-by-step `tutorial.rst` for newcomers, a recipe-focused `howto.rst` for practitioners, an `explanation.rst` gathering all platform conventions and design rationale, and the existing `api.rst`/`platforms.rst` as pure reference. The tutorial uses first-person plural and imperative steps with verifiable output at each stage. The how-to guides are action-first with minimal explanation, including new recipes for config merging via `iter_config_paths`, testing with mocks, and environment variable overrides. Platform convention prose that was duplicated between `platforms.rst` and `howto.rst` now lives in one place in `explanation.rst`. Beyond the restructure, this adds several Sphinx extensions (`sphinx-copybutton`, `sphinx-design`, `sphinx-sitemap`, `sphinxcontrib-mermaid`, `sphinxext-opengraph`) and a `docstrfmt` pre-commit hook for consistent RST and docstring formatting. The ruff config is adjusted to defer to `docstrfmt` for docstring style (`D213` ignored, `E501` ignored in favor of formatters). The `api.rst` now documents the `iter_*` methods and the `AppDirs` backwards-compatibility alias. The release workflow script is updated to match the new RST heading style used by `docstrfmt`.
1 parent 1d8448b commit 3e45fa9

File tree

20 files changed

+2179
-1612
lines changed

20 files changed

+2179
-1612
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ jobs:
8080
fi
8181
git config user.name "${{ github.actor }}"
8282
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
83-
header="$VERSION ($(date -u +%Y-%m-%d))"
84-
separator=$(printf '%0.s-' $(seq 1 ${#header}))
83+
header=" $VERSION ($(date -u +%Y-%m-%d))"
84+
separator=$(printf '%0.s*' $(seq 1 ${#header}))
8585
{
86-
head -2 docs/changelog.rst
87-
printf '%s\n%s\n%s\n\n' "$header" "$separator" "$CHANGELOG"
88-
tail -n +3 docs/changelog.rst
86+
head -4 docs/changelog.rst
87+
printf '%s\n%s\n%s\n%s\n\n' "$separator" "$header" "$separator" "$CHANGELOG"
88+
tail -n +5 docs/changelog.rst
8989
} > docs/changelog.tmp
9090
mv docs/changelog.tmp docs/changelog.rst
9191
git add docs/changelog.rst

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ repos:
4242
additional_dependencies:
4343
- mdformat-gfm
4444
- mdformat-ruff
45+
- repo: https://github.com/LilSpazJoekp/docstrfmt
46+
rev: v2.0.2
47+
hooks:
48+
- id: docstrfmt
49+
args: ["-l", "120"]
50+
additional_dependencies: ["sphinx>=9.1"]
4551
- repo: meta
4652
hooks:
4753
- id: check-hooks-apply

0 commit comments

Comments
 (0)