Add 'make [-C docs] htmllive' to rebuild and reload HTML files in your browser

This commit is contained in:
Hugo van Kemenade 2025-04-18 16:38:55 +03:00
parent 857b8846ea
commit 4f2751a190
3 changed files with 12 additions and 0 deletions

View File

@ -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"

View File

@ -20,6 +20,7 @@ help:
@echo "Please use \`make <target>' where <target> 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

View File

@ -44,6 +44,7 @@ optional-dependencies.docs = [
"furo",
"olefile",
"sphinx>=8.2",
"sphinx-autobuild",
"sphinx-copybutton",
"sphinx-inline-tabs",
"sphinxext-opengraph",