Read the Docs Implementation from GitHub¶
This guide documents how to host U-MIMIC documentation on Read the Docs (RTD) with GitHub as the source of truth.
Architecture¶
Code and docs live in GitHub.
RTD imports the GitHub repository.
Pushes and pull requests trigger RTD builds.
RTD serves versioned docs and PR previews.
Repository files required¶
The repository now includes:
.readthedocs.yaml: RTD build configurationdocs/conf.py: Sphinx configdocs/index.md: docs landing pagethis guide (
docs/readthedocs-github.md)
1. Import the repository into Read the Docs¶
Sign in to RTD with your GitHub account.
Click
Import a Project.Select the U-MIMIC GitHub repository.
Confirm the default branch (usually
main).
RTD will detect .readthedocs.yaml at repository root and use it for builds.
2. Connect GitHub webhooks¶
After importing:
Open RTD project
Admin->Integrations.Ensure GitHub integration webhook is active.
In GitHub, check
Settings->Webhooksfor an RTD webhook entry.
This ensures docs rebuild on push and pull request events.
3. Build configuration details¶
RTD uses .readthedocs.yaml:
Python:
3.11OS image: Ubuntu 24.04
Builder: Sphinx with config at
docs/conf.pyInstall command:
pip install .[docs]
.[docs] comes from pyproject.toml and currently installs:
sphinxmyst-parser
4. Local validation before pushing¶
Run docs build locally before opening a PR:
python -m pip install -e ".[docs]"
sphinx-build -b html docs docs/_build/html
If build succeeds, open docs/_build/html/index.html to preview.
5. Configure versions and preview behavior in RTD¶
In RTD project settings:
Versions: enable at leastlatestandstable.Automation Rules: enable pull request builds.Optionally hide inactive branches to reduce noise.
Recommended policy:
stable: latest tagged release branch/taglatest: default branch (main)PR builds: enabled for contributor review
6. Add docs status to GitHub (optional)¶
You can add the RTD badge to README.md and enable required checks in branch protection:
RTD build status
repo test workflow(s)
This prevents merges that break documentation.
7. Troubleshooting¶
Build fails with missing dependencies¶
Cause: docs dependency not included in pyproject.toml extras.
Fix: add package to [project.optional-dependencies].docs and retry build.
RTD does not rebuild on push¶
Cause: webhook missing or disabled.
Fix: re-sync integration from RTD Admin -> Integrations.
Operational checklist¶
Before each release:
Build docs locally with Sphinx.
Push docs changes to GitHub.
Confirm RTD build is green for
latest.Create release tag.
Confirm
stableversion is updated in RTD.
Acknowledgements¶
Parts of this documentation were created with assistance from ChatGPT Codex and Claude Code.