To ensure compatibility across different Sphinx and Python versions, use tox.
Running a specific environment:
tox -e py312-sphinx74
Viewing built documentation:
After a successful build, the HTML files are located in the directory specified by the Sphinx output (e.g., .tox/py312-sphinx74/tmp/html).
Comparing builds:
To spot UI issues, build multiple environments and compare them in a browser:
- Build environment A:
tox -e py312-sphinx62 - Build environment B:
tox -e py312-sphinx74 - Open both:
firefox .tox/py312-sphinx62/tmp/html/index.html and firefox .tox/py312-sphinx74/tmp/html/index.html
Testing against a specific git tag:
To compare a feature branch against a stable tag (e.g., 0.5.2), use the -qa postfix to prevent overwriting files:
% git checkout 0.5.2
% tox -e py310-sphinx53-qa
% git checkout feature/example-pull-request
% tox -e py310-sphinx53
% tox -e py312-sphinx74