Building The Docs¶
The documentation sources live directly in the docs/ directory and are
structured for Sphinx.
Sphinx Configuration¶
The Sphinx configuration file is docs/conf.py.
It currently enables:
sphinx.ext.autodocsphinx.ext.napoleon
Suggested build commands¶
From the repository root, common approaches are:
python -m sphinx -b html docs docs/_build/html
or, when sphinx-build is available on PATH:
sphinx-build -b html docs docs/_build/html
Notes¶
If Sphinx was installed into a virtual environment or a different interpreter than the shell default, use the matching Python executable for the build command.
Versioned GitHub Pages¶
The docs site is published from Git tags so each release keeps its own URL.
Behavior¶
pushing a
vX.Y.Ztag runs.github/workflows/docs-pages.ymlthe workflow rebuilds the full docs site for all matching tags
if
info/exists, its contents become the GitHub Pages site rootif
info/does not exist, the workflow generates a fallback homepagedocumentation lives under
/docs/each tag is published at
/docs/<tag>//docs/redirects to/docs/latest/every rendered site page gets the shared top navigation bar
a version selector in the Sphinx sidebar lets readers switch between tags
Deduplication¶
The workflow hashes the documentation inputs for each tag:
docs/piethorn/README.rstpyproject.tomlsetup.pyrequirements.txt
If two tags produce the same hash, the workflow builds that documentation tree
once under _builds/<hash>/ and publishes the tag paths as symbolic links to
that shared build. This keeps version navigation intact without rebuilding or
storing duplicate output for unchanged documentation versions. The latest
alias is also published under /docs/latest/.
Info Site Content¶
The optional info/ directory is treated as the non-documentation portion of
the GitHub Pages site.
Behavior:
.htmlfiles underinfo/are copied to the site root and get the shared top navigation injected.rstfiles underinfo/are rendered to.htmlpages.txtfiles underinfo/are rendered as plain-text pages inside the shared site chromeinfo/index.html,info/index.rst, orinfo/index.txtcan become the site homepageinfo/docsis reserved and will fail the build because/docs/is managed by the versioned documentation publisherconflicting source files such as
info/about.rstandinfo/about.htmlwill fail the build because they target the same output path
PyPI configuration¶
The publishing workflows are designed for trusted publishing rather than long-lived API tokens.
Configure PyPI and TestPyPI to trust the matching workflow file in this repository:
owner:
Officer-Erik-1K-88repository:
PieThornworkflow:
.github/workflows/live-publish.ymlwith environmentpypiworkflow:
.github/workflows/test-publish.ymlwith environmenttestpypi
After that setup:
create and push a
vX.Y.Ztag to runlive-publish.ymland publish to PyPIcreate and push a
vX.Y.ZrcNtag to runtest-publish.ymland publish to TestPyPIuse the
test-publish.ymlmanual workflow dispatch to dry-run a build against TestPyPI for any selected refuse the
live-publish.ymlmanual workflow dispatch to publish a selected ref to PyPI, and setgitreleaseif you also want the matching GitHub Release created after the PyPI publish succeeds