Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,19 @@ foreach(root ${DTS_ROOTS})
endforeach()

if(DT_TURBO_MODE)
message(WARNING "DT 'turbo mode' is enabled.\n"
"The index of Devicetree bindings won't be generated and Sphinx roles such as "
":dtcompatible: won't be able to link to them.")
list(APPEND DTS_ARGS --turbo-mode)
endif()

if(DOXYGENGROUPS_TURBO_MODE)
message(WARNING "Doxygen groups 'turbo mode' is enabled.\n"
"Doxygen groups won't be rendered in the documentation and Sphinx roles such as "
":c:func: won't be able to link to them.")
list(APPEND SPHINXOPTS_EXTRA -D zephyr_breathe_skip_doxygen_groups=1)
endif()

add_custom_target(
devicetree
COMMAND ${CMAKE_COMMAND} -E env
Expand Down
6 changes: 4 additions & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ SPHINXOPTS ?= -j auto -W --keep-going -T
SPHINXOPTS_EXTRA ?=
LATEXMKOPTS ?= -halt-on-error -no-shell-escape
DT_TURBO_MODE ?= 0
DOXYGENGROUPS_TURBO_MODE ?= 0

# ------------------------------------------------------------------------------
# Documentation targets

.PHONY: configure clean html html-fast latex pdf doxygen

html-fast:
${MAKE} html DT_TURBO_MODE=1
${MAKE} html DT_TURBO_MODE=1 DOXYGENGROUPS_TURBO_MODE=1

html latex pdf linkcheck doxygen: configure
cmake --build ${BUILDDIR} --target $@
Expand All @@ -29,7 +30,8 @@ configure:
-DSPHINXOPTS="${SPHINXOPTS}" \
-DSPHINXOPTS_EXTRA="${SPHINXOPTS_EXTRA}" \
-DLATEXMKOPTS="${LATEXMKOPTS}" \
-DDT_TURBO_MODE=${DT_TURBO_MODE}
-DDT_TURBO_MODE=${DT_TURBO_MODE} \
-DDOXYGENGROUPS_TURBO_MODE=${DOXYGENGROUPS_TURBO_MODE}

clean:
cmake --build ${BUILDDIR} --target clean
15 changes: 12 additions & 3 deletions doc/_extensions/zephyr/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,25 @@ class CustomDoxygenGroupDirective(DoxygenGroupDirective):
"""Monkey patch for Breathe's DoxygenGroupDirective."""

def run(self) -> List[Node]:
nodes = super().run()
if self.config.zephyr_breathe_skip_doxygen_groups:
note = nodes.attention()
note += nodes.Text(
f"Doxygen group {self.arguments[0]} was excluded from the documentation."
)

doxygengroup_node = [note]
else:
doxygengroup_node = super().run()

if self.config.zephyr_breathe_insert_related_samples:
return [RelatedCodeSamplesNode(id=self.arguments[0]), *nodes]
return [RelatedCodeSamplesNode(id=self.arguments[0]), *doxygengroup_node]
else:
return nodes
return doxygengroup_node


def setup(app):
app.add_config_value("zephyr_breathe_insert_related_samples", False, "env")
app.add_config_value("zephyr_breathe_skip_doxygen_groups", False, "env")
Comment on lines +310 to +328
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is overloading the Zephyr domain extension purpose. Shouldn't this be a separate extension?


app.add_domain(ZephyrDomain)

Expand Down
11 changes: 5 additions & 6 deletions doc/contribute/documentation/generation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,17 @@ Developer-mode Document Building
********************************

When making and testing major changes to the documentation, we provide an option
to temporarily stub-out the auto-generated Devicetree bindings documentation so
the doc build process runs faster.
to temporarily stub-out some of the more time-consuming parts of the build, such
as cross references to Doxygen-generated content, or Devicetree bindings
documentation, so that the doc build process runs faster.

To enable this mode, set the following option when invoking cmake::
To enable this mode, set the following options when invoking cmake::

-DDT_TURBO_MODE=1
-DDT_TURBO_MODE=1 -DDOXYGENGROUPS_TURBO_MODE=1

or invoke make with the following target::

cd ~/zephyr

# To generate HTML output without detailed Kconfig
make html-fast

Viewing generated documentation locally
Expand Down