diff --git a/doc/Makefile b/doc/Makefile index 8fbbefbd..2ab5a5ce 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -9,6 +9,14 @@ SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = _build +# Require stricter builds with +# -n: warn on missing references +# -W: error on warnings +# --keep-going: find all warnings +# https://www.sphinx-doc.org/en/master/man/sphinx-build.html +STRICT = -n -W --keep-going +LOOSE = -n + GENERATE = ../devel/generate-command-doc # Put it first so that "make" without argument is like "make help". @@ -21,7 +29,7 @@ help: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile if [[ $@ != clean ]]; then $(GENERATE); fi - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(STRICT) $(SPHINXOPTS) $(O) HOST ?= 127.0.0.1 PORT ?= 8000 @@ -30,4 +38,4 @@ serve: dirhtml cd "$(BUILDDIR)/dirhtml" && python3 -m http.server --bind "$(HOST)" "$(PORT)" livehtml: - sphinx-autobuild -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)/dirhtml" --host "$(HOST)" --port "$(PORT)" --watch ../nextstrain/cli --pre-build "$(GENERATE)" $(SPHINXOPTS) $(O) + sphinx-autobuild -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)/dirhtml" --host "$(HOST)" --port "$(PORT)" --watch ../nextstrain/cli --pre-build "$(GENERATE)" $(LOOSE) $(SPHINXOPTS) $(O)