Skip to content

docs: build the reference with Sphinx and publish it to GitHub Pages - #4

Merged
stephen-masters merged 1 commit into
mainfrom
worktree-docs-sphinx-pages
Nov 1, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
worktree-docs-sphinx-pages

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

What this adds

API documentation built with Sphinx, in the arrangement of the Tetrak reference, served at https://scattercode.github.io/sillybos/ once merged.

  • docs/: conf.py (furo, autodoc with napoleon, viewcode, MyST, sphinx-argparse), index.md (includes the README between two comment markers, so nothing is copied by hand), api.md (what the package exports, sillybos.pillow, and the errors a caller can catch), cli.md (every flag, from the parser). docs/logo.png and docs/advisories/ stay where they are; the advisories guide joins the site as a page.
  • .github/workflows/docs.yml: builds with -W on every pull request; on a push to main, deploys with upload-pages-artifact and deploy-pages from a job of its own. No gh-pages branch. zizmor reports nothing.
  • pyproject.toml: a docs extra (runtime dependencies stay empty) and a Documentation URL; uv.lock regenerated, uv lock --check passes.
  • README link near the top, a docs check in CONTRIBUTING.md, and the check named in AGENTS.md.
  • One docstring change: check()'s Returns ended its first line with a colon, which napoleon reads as a type.

One manual step

GitHub Pages is not yet enabled on this repository (the Pages API returns 404). Before the first deploy can succeed, set Settings → Pages → Build and deployment → Source to GitHub Actions, once. Until then the build job passes and the deploy job fails.

Notes

  • The page title carries the hatch-vcs version, so a merge that cuts no release shows X.Y.Z.devN until the next release commit lands, as Tetrak's does; conf.py says why that is kept.
  • actions/configure-pages is left out on purpose: Sphinx needs none of its outputs, and it would need Pages permissions on a job that otherwise only reads.

Checks

ruff check ., ruff format --check ., mypy, pytest --cov (98%, 326 passed), uv lock --check, uvx zizmor --min-severity medium .github/workflows and sphinx-build -W --keep-going -b html docs docs/_build/html all pass locally.

🤖 Generated with Claude Code

A docs/ Sphinx project in the arrangement of the Tetrak reference: furo,
autodoc with napoleon, MyST for the Markdown pages, sphinx-argparse for the
command. The index includes the README between two comment markers (what
the library is, install, use, the policy table, what it does and does not
do), so nothing is copied by hand; api.md documents what the package
exports, sillybos.pillow and the errors a caller can catch, and cli.md
every flag from the parser. The advisories guide in docs/ joins the site
as a page. conf.py reads the name tuples' and presets' docstrings from
sillybos.policy, where they are written, since autodoc only looks in the
module named in the directive; the page title keeps hatch-vcs's .devN on
an untagged commit, as Tetrak's does.

docs.yml builds the site with warnings as errors on every pull request
and, on a push to main, deploys it with upload-pages-artifact and
deploy-pages from a job of its own, so a broken docstring fails review
rather than main and nothing is committed to a branch. Publishing needs
the repository's Pages source set to GitHub Actions once, by hand.

The Sphinx toolchain is a `docs` extra; the runtime dependencies stay
empty, and uv.lock is regenerated. The README, pyproject.toml's URLs,
CONTRIBUTING.md and AGENTS.md point at the site and name the build as a
check. One docstring is touched: check()'s Returns ended its first line
with a colon, which napoleon reads as a type, and rendered split.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@stephen-masters
stephen-masters merged commit 24f4d01 into main Nov 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant