22#
33
44# You can set these variables from the command line.
5- SPHINXOPTS =
6- SPHINXBUILD = sphinx-build
7- PAPER =
8- BUILDDIR = .
5+ SPHINXOPTS =
6+ SPHINXBUILD = sphinx-build
7+ PAPER =
8+ BUILDDIR = .
9+ SPHINXAUTOBUILD = sphinx-autobuild
10+ IGNOREWATCH = --ignore "/www/_build" \
11+ --ignore "/www/.idea"
912
1013# Internal variables.
1114PAPEROPT_a4 = -D latex_paper_size=a4
@@ -14,7 +17,7 @@ ALLSPHINXOPTS = -c $(BUILDDIR) -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(
1417# the i18n builder cannot share the environment and doctrees with the others
1518I18NSPHINXOPTS = $(PAPEROPT_$(PAPER ) ) $(SPHINXOPTS ) .
1619
17- .PHONY : help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
20+ .PHONY : help clean html livehtml dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
1821
1922help :
2023@echo " Please use \` make <target>' where <target> is one of"
3740@echo " changes to make an overview of all changed/added/deprecated items"
3841@echo " linkcheck to check all external links for integrity"
3942@echo " doctest to run all doctests embedded in the documentation (if enabled)"
43+ @echo " livehtml to keep recreating the files that are changed"
4044
4145clean :
4246-rm -rf $(BUILDDIR ) /*
@@ -151,3 +155,9 @@ doctest:
151155$(SPHINXBUILD ) -b doctest $(ALLSPHINXOPTS ) $(BUILDDIR ) /doctest
152156@echo " Testing of doctests in the sources finished, look at the " \
153157 " results in $( BUILDDIR) /doctest/output.txt."
158+
159+ livehtml :
160+ $(SPHINXBUILD ) -b html $(ALLSPHINXOPTS ) $(BUILDDIR ) /html
161+ $(SPHINXAUTOBUILD ) --host 0.0.0.0 --port 8000 --watch /www -b html $(ALLSPHINXOPTS ) $(IGNOREWATCH ) /www/_build/html
162+ @echo
163+ @echo " Listening to changes and rebuilding files"
0 commit comments