Skip to content

Commit 7277187

Browse files
authored
docs: Use sphinx-autobuild to streamline documentation (#339)
See also: https://github.com/executablebooks/sphinx-autobuild
2 parents 1216fed + f0e27ca commit 7277187

File tree

5 files changed

+115
-10
lines changed

5 files changed

+115
-10
lines changed

Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,8 @@ watch_test:
2626
build_docs:
2727
$(MAKE) -C docs html
2828

29-
watch_docs:
30-
if command -v entr > /dev/null; then ${DOC_FILES} | entr -c $(MAKE) build_docs; else $(MAKE) build_docs entr_warn; fi
31-
32-
serve_docs:
33-
$(MAKE) -C docs serve
34-
35-
dev_docs:
36-
$(MAKE) -j watch_docs serve_docs
29+
start_docs:
30+
$(MAKE) -C docs start
3731

3832
flake8:
3933
flake8 libvcs tests

docs/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,6 @@ serve_py3:
175175

176176
dev:
177177
$(MAKE) -j watch serve
178+
179+
start:
180+
poetry run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/developing.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ Rerun tests on file change: `make watch_test` (requires [entr(1)])
1919

2020
## Documentation
2121

22+
[sphinx-autobuild] will automatically build the docs, watch for file changes and launch a server.
23+
24+
From home directory: `make start_docs`
25+
From inside `docs/`: `make start`
26+
27+
[sphinx-autobuild]: https://github.com/executablebooks/sphinx-autobuild
28+
29+
### Manual documentation (the hard way)
30+
2231
Default preview server: http://localhost:8022
2332

2433
`cd docs/` and `make html` to build. `make serve` to start http server.

poetry.lock

Lines changed: 99 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ alagitpull = "^0.1.0"
5454
sphinx-issues = "^3.0.0"
5555
sphinx-click = "*"
5656
sphinx-autodoc-typehints = "~1.17.0"
57+
sphinx-autobuild = "^2021.3.14"
5758
myst_parser = "~0.17.0"
5859

5960
### Testing ###
@@ -73,7 +74,7 @@ isort = "*"
7374
flake8 = "*"
7475

7576
[tool.poetry.extras]
76-
docs = ["sphinx", "sphinx-issues", "sphinx-click", "sphinx-autodoc-typehints", "myst_parser", "alagitpull"]
77+
docs = ["sphinx", "sphinx-issues", "sphinx-click", "sphinx-autodoc-typehints", "myst_parser", "sphinx-autobuild", "alagitpull"]
7778
test = ["pytest", "pytest-rerunfailures"]
7879
coverage = ["codecov", "coverage", "pytest-cov"]
7980
format = ["black", "isort"]

0 commit comments

Comments
 (0)