Skip to content

Commit 51805e4

Browse files
committed
docs: Rebuild docs from scratch, as required for proper only:: handling.
Docs are now by default rebuilt from scratch, as required to build conditionalized (i.e. using only:: directive) docs across different output types. We have pretty small docset, so that's still rather fast. However, if that's a concern, incremental rebuilds can be used by passing "FORCE=" (nothing after =) as a make parameter. This will work when using the same output type (e.g. only "html").
1 parent 236838a commit 51805e4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

docs/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
88
BUILDDIR = build/$(MICROPY_PORT)
9+
# Run "make FORCE= ..." to avoid rebuilding from scratch (and risk
10+
# producing incorrect docs).
11+
FORCE = -E
912

1013
# User-friendly check for sphinx-build
1114
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
@@ -50,7 +53,7 @@ clean:
5053
rm -rf $(BUILDDIR)/*
5154

5255
html:
53-
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
56+
$(SPHINXBUILD) $(FORCE) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
5457
@echo
5558
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
5659

@@ -111,7 +114,7 @@ latex:
111114
"(use \`make latexpdf' here to do that automatically)."
112115

113116
latexpdf:
114-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
117+
$(SPHINXBUILD) $(FORCE) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115118
@echo "Running LaTeX files through pdflatex..."
116119
$(MAKE) -C $(BUILDDIR)/latex all-pdf
117120
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

0 commit comments

Comments
 (0)