doc: conf.py: fix warnings about docs appearing in index and index-tex

Implement a workaround to ensure only one of the two top-level indexes
is included in the documentation build, preventing Sphinx from issuing
INFO notices about documents being referenced in both index and
index-tex toctrees.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé
2025-09-04 21:55:28 +02:00
committed by Henrik Brix Andersen
parent d6f28bd3d4
commit 0871c7e147

View File

@@ -114,6 +114,14 @@ if not west_found:
else:
exclude_patterns.append("**/*west-not-found*")
# Ensure only one of the two top-level indexes ever gets included.
# This is a workaround for Sphinx issuing INFO notices about being referenced in
# multiple toctrees.
if tags.has("convertimages"): # pylint: disable=undefined-variable # noqa: F821
exclude_patterns.append("index.rst")
else:
exclude_patterns.append("index-tex.rst")
pygments_style = "sphinx"
highlight_language = "none"