Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit d35ffdb

Browse files
coretlgilesknap
authored andcommitted
Add sphinx autobuild
1 parent 92f10b4 commit d35ffdb

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
git_branch = check_output("git branch --show-current".split(), cwd=root)
2525
version = git_branch.decode().strip()
2626
else:
27-
branch = "main"
2827
version = release
2928

3029
extensions = [

docs/developer/how-to/build-docs.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,22 @@ locally with a web browse::
1717

1818
$ firefox build/html/index.html
1919

20+
Autobuild
21+
---------
22+
23+
You can also run an autobuild process, which will watch your ``docs``
24+
directory for changes and rebuild whenever it sees changes, reloading any
25+
browsers watching the pages::
26+
27+
$ tox -e docs autobuild
28+
29+
You can view the pages at localhost::
30+
31+
$ firefox http://localhost:8000
32+
33+
If you are making changes to source code too, you can tell it to watch
34+
changes in this directory too::
35+
36+
$ tox -e docs autobuild -- --watch src
37+
2038
.. _sphinx: https://www.sphinx-doc.org/

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dev =
4141
pydata-sphinx-theme < 0.10.1
4242
pytest-cov
4343
setuptools_scm[toml]>=6.2
44+
sphinx-autobuild
4445
sphinx-copybutton
4546
sphinx-design
4647
tox
@@ -122,5 +123,5 @@ allowlist_externals = pre-commit
122123
commands = pre-commit run --all-files {posargs}
123124

124125
[testenv:docs]
125-
allowlist_externals = sphinx-build
126-
commands = sphinx-build -EWT --keep-going docs build/html {posargs}
126+
allowlist_externals = sphinx-build sphinx-autobuild
127+
commands = sphinx-{posargs:build -EW --keep-going} -T docs build/html

0 commit comments

Comments
 (0)