From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: "Robin Jarry" <rjarry@redhat.com>,
"Juraj Linkeš" <juraj.linkes@pantheon.tech>,
"Luca Vizzarro" <luca.vizzarro@arm.com>,
"Dean Marx" <dmarx@iol.unh.edu>,
"Jeremy Spewock" <jspewock@iol.unh.edu>
Subject: [PATCH] doc: fix Sphinx build without RTD theme
Date: Thu, 17 Oct 2024 19:14:13 +0200 [thread overview]
Message-ID: <20241017171413.2846973-1-thomas@monjalon.net> (raw)
DTS is using a specific configuration of Sphinx
which is supported only with the theme Read The Docs.
If not available, this error may be seen:
unsupported theme option 'collapse_navigation' given
In order to allow doc generation without this theme,
a check is added to make the specific configuration optional.
Fixes: 7f9326423a04 ("dts: add API doc generation")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Robin Jarry <rjarry@redhat.com>
---
doc/guides/conf.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/doc/guides/conf.py b/doc/guides/conf.py
index 200e98b0bc..b553d9d5bf 100644
--- a/doc/guides/conf.py
+++ b/doc/guides/conf.py
@@ -16,13 +16,12 @@
try:
import sphinx_rtd_theme
-
html_theme = "sphinx_rtd_theme"
-except:
+except ImportError:
print('Install the sphinx ReadTheDocs theme for improved html documentation '
'layout: https://sphinx-rtd-theme.readthedocs.io/',
file=stderr)
- pass
+ html_theme = "default"
stop_on_error = ('-W' in argv)
@@ -85,10 +84,11 @@
toc_object_entries = True
toc_object_entries_show_parents = 'hide'
# DTS Sidebar config.
- html_theme_options = {
- 'collapse_navigation': False,
- 'navigation_depth': -1, # unlimited depth
- }
+ if html_theme == "sphinx_rtd_theme":
+ html_theme_options = {
+ 'collapse_navigation': False,
+ 'navigation_depth': -1, # unlimited depth
+ }
# Add path to DTS sources so that Sphinx can find them.
dpdk_root = dirname(dirname(dirname(__file__)))
--
2.46.0
next reply other threads:[~2024-10-17 17:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 17:14 Thomas Monjalon [this message]
2024-10-18 10:18 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241017171413.2846973-1-thomas@monjalon.net \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=dmarx@iol.unh.edu \
--cc=jspewock@iol.unh.edu \
--cc=juraj.linkes@pantheon.tech \
--cc=luca.vizzarro@arm.com \
--cc=rjarry@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).