Publishing the documentation
The documentation (including the auto-generated API reference from docstrings) is built with MkDocs and the Material theme. You can build and publish it so it is publicly accessible when the package is released.
Build locally
From the project root, install dev dependencies and build:
The static site is written to site/. Preview it with:
Then open http://127.0.0.1:8000. The Reference → API reference section is generated from the code (docstrings and type hints) via mkdocstrings.
Hosting (public access)
GitHub Pages
- Enable Pages first (required before the workflow can deploy): In the repo go to Settings → Pages. Under Build and deployment, set Source to GitHub Actions. Save. (If you skip this, the workflow will fail with "Get Pages site failed" / Not Found.)
- The workflow in
.github/workflows/docs.ymlbuilds the site and deploys it on push tomain. No extra workflow setup needed. - Set Project URLs in
pyproject.tomlso Documentation points to the Pages URL, e.g.https://<org>.github.io/gradiend/.
Once configured, every push to the docs (or to main) can update the published site. Users and package index will see the documentation link in the project metadata.
Read the Docs
- Sign up at readthedocs.org and import the repository.
- Set the Documentation type to MkDocs.
- Use a config file path of
mkdocs.yml(default). - Add
mkdocs-materialandmkdocstrings[python]to the Requirements file (e.g. createdocs/requirements.txtwith those packages, or add them in the RTD admin). - Build. Read the Docs will run
mkdocs buildand host the site.
Then set Documentation in pyproject.toml to the Read the Docs URL (e.g. https://gradiend.readthedocs.io/) so the PyPI project page links to the published docs.
Linking from the package
In pyproject.toml, set:
That URL is shown on PyPI and by pip show gradiend, so users can reach the same documentation (including the API reference) from the released package.