File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ You need to install ``tox`` (``pip3 install tox``) to run tests and lint checks
8181 # build the documentation - the result will be generated in build/sphinx/html/:
8282 tox -e docs
8383
84+ # build and serve the documentation site locally for validating changes
85+ tox -e docs-serve
86+
8487 # List all available tox environments
8588 tox list
8689
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ jinja2==3.1.5
44myst-parser==4.0.0
55sphinx==8.1.3
66sphinxcontrib-autoprogram==0.1.9
7+ sphinx-autobuild==2024.10.3
Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ passenv =
2626 NO_COLOR
2727 PWD
2828 PY_COLORS
29- setenv = VIRTUAL_ENV ={envdir}
29+ setenv =
30+ DOCS_SOURCE = docs
31+ DOCS_BUILD = build/sphinx/html
32+ VIRTUAL_ENV ={envdir}
3033whitelist_externals = true
3134usedevelop = True
3235install_command = pip install {opts} {packages} -e .
@@ -99,8 +102,17 @@ per-file-ignores =
99102 gitlab/v4/objects/__init__.py:F401,F403
100103
101104[testenv:docs]
105+ description = Builds the docs site. Generated HTML files will be available in ' {env:DOCS_BUILD}' .
102106deps = -r{toxinidir}/requirements-docs.txt
103- commands = sphinx-build -n -W --keep-going -b html docs build/sphinx/html
107+ commands = sphinx-build -n -W --keep-going -b html {env:DOCS_SOURCE} {env:DOCS_BUILD}
108+
109+ [testenv:docs-serve]
110+ description =
111+ Builds and serves the HTML docs site locally. \
112+ Use this for verifying updates to docs. \
113+ Changes to docs files will be automatically rebuilt and served.
114+ deps = -r{toxinidir}/requirements-docs.txt
115+ commands = sphinx-autobuild {env:DOCS_SOURCE} {env:DOCS_BUILD} --open-browser --port 8000
104116
105117[testenv:cover]
106118commands =
You can’t perform that action at this time.
0 commit comments