diff --git a/doc/Makefile b/doc/Makefile index c9ae0e700978a..c2cc51f0c3ce2 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -16,6 +16,16 @@ DT_TURBO_MODE ?= 0 html-fast: ${MAKE} html DT_TURBO_MODE=1 +# The `minimal` tag turns off all slow sphinx features for a much faster +# incremental build when editing .rst files interactively. As usual when +# making significant sphinx configuration changes, you must delete +# doc/_build/ first. WARNING: doxygen integration (breathe) will be +# missing, so building from scratch will print a LOT of warnings! +# However this is very useful for small, drive-by .rst fixes. +html-minimal: + ${MAKE} html DT_TURBO_MODE=1 SPHINXOPTS='-t minimal ${SPHINXOPTS}' + + html latex pdf linkcheck doxygen: configure cmake --build ${BUILDDIR} --target $@ diff --git a/doc/conf.py b/doc/conf.py index 2545ffea54efb..604bcc6b35550 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -67,14 +67,12 @@ # -- General configuration ------------------------------------------------ extensions = [ - "breathe", "sphinx.ext.todo", "sphinx.ext.extlinks", "sphinx.ext.autodoc", "sphinx.ext.graphviz", "zephyr.application", "zephyr.html_redirects", - "zephyr.kconfig", "zephyr.dtcompatible-role", "zephyr.link-roles", "sphinx_tabs.tabs", @@ -86,6 +84,14 @@ "zephyr.external_content", ] +# List of semi-optional features that make the incremental build +# and/or the build from scratch significantly slower. +if not tags.has("minimal"): # pylint: disable=undefined-variable + extensions += [ + "breathe", + "zephyr.kconfig", + ] + # Only use SVG converter when it is really needed, e.g. LaTeX. if tags.has("svgconvert"): # pylint: disable=undefined-variable extensions.append("sphinxcontrib.rsvgconverter")