diff --git a/Makefile b/Makefile index 99b360ec..8c90bc41 100644 --- a/Makefile +++ b/Makefile @@ -26,5 +26,10 @@ help: .PHONY: help Makefile +# specific rule to use sphinx-autobuild +watch: Makefile + @sphinx-autobuild -b html "$(SRC)" "$(OUT)"/html $(OPTS) + +# anything else %: Makefile @$(CMD) -M $@ "$(SRC)" "$(OUT)" $(OPTS) diff --git a/guides/how-to-contribute-to-this-documentation.rst b/guides/how-to-contribute-to-this-documentation.rst index ecf3f6dc..8742d0e6 100644 --- a/guides/how-to-contribute-to-this-documentation.rst +++ b/guides/how-to-contribute-to-this-documentation.rst @@ -32,6 +32,12 @@ and the `MyST Markdown parser $ pip install --upgrade sphinx sphinx_rtd_theme myst_parser +If you want to use the auto-build and auto-refresh feature, also install +`sphinx-autobuild `_. + +.. code-block:: bash + + $ pip install --upgrade sphinx-autobuild Cloning the repository ====================== @@ -75,6 +81,16 @@ From the base of the repository, run: You should now be able to view the documentation in your web browser. The homepage is at ``_build/html/index.html``. +To automatically build the documentation and refresh your web browser whenever +you save changes, run: + +.. code-block:: bash + + $ make clean && make watch + +Keep this running in the background, then navigate to http://127.0.0.1:8000 +(*not* the local .html file). + Saving your work ================