From bd9109c8c7374b968b24d5a260bd48e0341261d9 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sat, 28 Oct 2023 13:11:04 +0300 Subject: [PATCH 1/2] Add 'make autobuild' to rebuild and reload HTML files in your browser --- Makefile | 6 ++++++ requirements.txt | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6e25d9389..3da1e3ccc 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ help: @echo " venv to create a venv with necessary tools" @echo " html to make standalone HTML files" @echo " htmlview to open the index page built by the html target in your browser" + @echo " autobuild to rebuild and reload HTML files in your browser" @echo " clean to remove the venv and build files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @@ -179,6 +180,11 @@ doctest: ensure-venv htmlview: html $(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('_build/html/index.html'))" +.PHONY: autobuild +autobuild: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild +autobuild: SPHINXOPTS = # sphinx-autobuild has no "--keep-going" +autobuild: html + .PHONY: check check: ensure-venv # Ignore the tools and venv dirs and check that the default role is not used. diff --git a/requirements.txt b/requirements.txt index ebf044d00..2a5a60dbd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,10 @@ -Sphinx~=7.2.6 furo>=2022.6.4 jinja2 +sphinx-autobuild sphinx-inline-tabs>=2023.4.21 sphinx-lint==0.6.8 sphinx-notfound-page>=1.0.0 sphinx_copybutton>=0.3.3 sphinxext-opengraph>=0.7.1 sphinxext-rediraffe +Sphinx~=7.2.6 From 24abdf34592263a059f6b1d6384ccabf68d2c7bd Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 29 Oct 2023 20:48:43 +0200 Subject: [PATCH 2/2] Ignore changes in venv and .idea --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3da1e3ccc..8bfe521c9 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,7 @@ htmlview: html .PHONY: autobuild autobuild: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild -autobuild: SPHINXOPTS = # sphinx-autobuild has no "--keep-going" +autobuild: SPHINXOPTS = --re-ignore="/\.idea/|/venv/" autobuild: html .PHONY: check