A pre-commit hook that will fail if documentation (eg for readthedocs.io) can't be built using sphinx
Using pre-commit
Builds documentation using sphinx, returns PASSED to pre-config if the documentation compiles (even with warnings)
Use in your .pre-commit-config.yaml
file like:
- repo: https://github.com/thclark/pre-commit-sphinx
rev: 0.2.0
hooks:
- id: build-docs
args: ['--flags', '"-W"', '--builder', 'html', '--source-dir', 'docs', '--html-dir', 'docs/_build/html']
language_version: python3