From d3c488d4ebb938711984e18b835e4f6d6186ea0c Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Fri, 17 Feb 2023 11:41:14 +0100 Subject: [PATCH] Add make watch to documentation --- docs/Makefile | 17 ++++++++++++++++- docs/requirements.txt | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 11efdb9c3..68f368bc8 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,6 +5,7 @@ SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = +SOURCEDIR = source BUILDDIR = build # User-friendly check for sphinx-build @@ -19,11 +20,12 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sou # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext +.PHONY: help clean watch html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" + @echo " watch to make standalone HTML files and watch for changes" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @@ -51,6 +53,19 @@ help: clean: rm -rf $(BUILDDIR)/* +watch: clean + @echo + @echo "Building and watching for changes in the documentation." + sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" \ + -b html \ + --ignore='**venv' \ + --ignore='**.gitlab' \ + --ignore='*.egg-info' \ + --ignore='bin' \ + --ignore='**_includes/**/*.txt' \ + --watch='autosubmit' \ + $(SPHINXOPTS) $(O) + html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo diff --git a/docs/requirements.txt b/docs/requirements.txt index 82133027c..3bf337cd6 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ -sphinx +sphinx==5.* +sphinx-autobuild==2021.3.* sphinx_rtd_theme -- GitLab