From 4f2751a1909739ac4951cd55d27cd6614d2a92a1 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 18 Apr 2025 16:38:55 +0300 Subject: [PATCH 1/6] Add 'make [-C docs] htmllive' to rebuild and reload HTML files in your browser --- Makefile | 5 +++++ docs/Makefile | 6 ++++++ pyproject.toml | 1 + 3 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 53164b08a90..b85dbdb0627 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,10 @@ doc html: htmlview: $(MAKE) -C docs htmlview +.PHONY: htmllive +htmllive: + $(MAKE) -C docs htmllive + .PHONY: doccheck doccheck: $(MAKE) doc @@ -43,6 +47,7 @@ help: @echo " docserve run an HTTP server on the docs directory" @echo " html make HTML docs" @echo " htmlview open the index page built by the html target in your browser" + @echo " htmllive to rebuild and reload HTML files in your browser" @echo " install make and install" @echo " install-coverage make and install with C coverage" @echo " lint run the lint checks" diff --git a/docs/Makefile b/docs/Makefile index e90af0519c6..2cb6853d9cf 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -20,6 +20,7 @@ help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " htmlview to open the index page built by the html target in your browser" + @echo " htmllive to rebuild and reload HTML files in your browser" @echo " serve to start a local server for viewing docs" @echo " livehtml to start a local server for viewing docs and auto-reload on change" @echo " dirhtml to make HTML files named index.html in directories" @@ -201,6 +202,11 @@ doctest: htmlview: html $(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$(BUILDDIR)/html/index.html'))" +.PHONY: htmllive +htmllive: SPHINXBUILD = sphinx-autobuild +htmllive: SPHINXOPTS = --open-browser --delay 0 +htmllive: html + .PHONY: livehtml livehtml: html livereload $(BUILDDIR)/html -p 33233 diff --git a/pyproject.toml b/pyproject.toml index e8e76796a69..a3ff9723b4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,7 @@ optional-dependencies.docs = [ "furo", "olefile", "sphinx>=8.2", + "sphinx-autobuild", "sphinx-copybutton", "sphinx-inline-tabs", "sphinxext-opengraph", From 1b2b15e6a03a8dad36a1d8a352c6633392fbce50 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 18 Apr 2025 16:44:00 +0300 Subject: [PATCH 2/6] Remove livehtml target --- docs/Guardfile | 10 ---------- docs/Makefile | 5 ----- 2 files changed, 15 deletions(-) delete mode 100755 docs/Guardfile diff --git a/docs/Guardfile b/docs/Guardfile deleted file mode 100755 index 16a891a730d..00000000000 --- a/docs/Guardfile +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 -from __future__ import annotations - -from livereload.compiler import shell -from livereload.task import Task - -Task.add("*.rst", shell("make html")) -Task.add("*/*.rst", shell("make html")) -Task.add("Makefile", shell("make html")) -Task.add("conf.py", shell("make html")) diff --git a/docs/Makefile b/docs/Makefile index 2cb6853d9cf..f0f6386f720 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -22,7 +22,6 @@ help: @echo " htmlview to open the index page built by the html target in your browser" @echo " htmllive to rebuild and reload HTML files in your browser" @echo " serve to start a local server for viewing docs" - @echo " livehtml to start a local server for viewing docs and auto-reload on change" @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" @@ -207,10 +206,6 @@ htmllive: SPHINXBUILD = sphinx-autobuild htmllive: SPHINXOPTS = --open-browser --delay 0 htmllive: html -.PHONY: livehtml -livehtml: html - livereload $(BUILDDIR)/html -p 33233 - .PHONY: serve serve: cd $(BUILDDIR)/html; $(PYTHON) -m http.server From 5122812ea4c5d92068d0a6927c2d8a74bd37f23f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 19 Apr 2025 16:13:20 +0300 Subject: [PATCH 3/6] Use same Python in Makefile Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- docs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index f0f6386f720..4412fc80687 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -202,7 +202,7 @@ htmlview: html $(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$(BUILDDIR)/html/index.html'))" .PHONY: htmllive -htmllive: SPHINXBUILD = sphinx-autobuild +htmllive: SPHINXBUILD = $(PYTHON) -m sphinx_autobuild htmllive: SPHINXOPTS = --open-browser --delay 0 htmllive: html From 6e35168e9f2589bff7892fc809a4e3a7dd23d1bc Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 19 Apr 2025 23:09:38 +0300 Subject: [PATCH 4/6] Consistent help Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b85dbdb0627..5a815245402 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ help: @echo " docserve run an HTTP server on the docs directory" @echo " html make HTML docs" @echo " htmlview open the index page built by the html target in your browser" - @echo " htmllive to rebuild and reload HTML files in your browser" + @echo " htmllive rebuild and reload HTML files in your browser" @echo " install make and install" @echo " install-coverage make and install with C coverage" @echo " lint run the lint checks" From 7da1715a67132086a1823b4408ba905737c45775 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 19 Apr 2025 23:12:55 +0300 Subject: [PATCH 5/6] Alphabetise help Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5a815245402..51089064330 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,8 @@ help: @echo " doc make HTML docs" @echo " docserve run an HTTP server on the docs directory" @echo " html make HTML docs" - @echo " htmlview open the index page built by the html target in your browser" @echo " htmllive rebuild and reload HTML files in your browser" + @echo " htmlview open the index page built by the html target in your browser" @echo " install make and install" @echo " install-coverage make and install with C coverage" @echo " lint run the lint checks" From 53b53eaa87a9d87884d947a0c4703e4fa77481eb Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 19 Apr 2025 23:16:33 +0300 Subject: [PATCH 6/6] Revert "Alphabetise help" This reverts commit 7da1715a67132086a1823b4408ba905737c45775. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 51089064330..5a815245402 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,8 @@ help: @echo " doc make HTML docs" @echo " docserve run an HTTP server on the docs directory" @echo " html make HTML docs" - @echo " htmllive rebuild and reload HTML files in your browser" @echo " htmlview open the index page built by the html target in your browser" + @echo " htmllive rebuild and reload HTML files in your browser" @echo " install make and install" @echo " install-coverage make and install with C coverage" @echo " lint run the lint checks"