Repository navigation
docs: build the reference with Sphinx and publish it to GitHub Pages - #4
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pnganddocs/advisories/stay where they are; the advisories guide joins the site as a page..github/workflows/docs.yml: builds with-Won every pull request; on a push tomain, deploys withupload-pages-artifactanddeploy-pagesfrom a job of its own. Nogh-pagesbranch. zizmor reports nothing.pyproject.toml: adocsextra (runtime dependencies stay empty) and aDocumentationURL;uv.lockregenerated,uv lock --checkpasses.docscheck inCONTRIBUTING.md, and the check named inAGENTS.md.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
X.Y.Z.devNuntil the next release commit lands, as Tetrak's does;conf.pysays why that is kept.actions/configure-pagesis 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/workflowsandsphinx-build -W --keep-going -b html docs docs/_build/htmlall pass locally.🤖 Generated with Claude Code