diff --git a/CHANGES.rst b/CHANGES.rst index e7264563..30aeb8f6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -63,6 +63,7 @@ New features: - Test compatibility with Python 3.12 - Add function ``icalendar.use_pytz()``. +- Add `sphinx-autobuild` for `livehtml` Makefile target. Bug fixes: diff --git a/docs/Makefile b/docs/Makefile index 7310e33b..53319b8d 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,11 +2,12 @@ # # You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build -LOCALESDIR = _locales +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXAUTOBUILD = sphinx-autobuild +PAPER = +BUILDDIR = _build +LOCALESDIR = _locales # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 @@ -15,7 +16,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext livehtml help: @echo "Please use \`make ' where is one of" @@ -159,3 +160,9 @@ doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." + +livehtml: + $(SPHINXAUTOBUILD) \ + --ignore "*.swp" \ + --port 8050 \ + -b html . "$(BUILDDIR)/html" $(SPHINXOPTS) $(O) diff --git a/requirements_docs.txt b/requirements_docs.txt index 75b22d35..3691eef5 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -1,3 +1,4 @@ Sphinx>=1.2.3 sphinx_rtd_theme +sphinx-autobuild .