doc: fix Sphinx build without RTD theme
PATCH 1/1 doc: fix Sphinx build without RTD theme
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 <[email protected]>
Signed-off-by Robin Jarry <[email protected]>
--- doc/guides/conf.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
doc/guides/conf.py +7 -7
@@ -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__)))
Signature · 1 line
2.46.0
17/10/2024 19:14, Thomas Monjalon:
Quoted 5 lines
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
Quoted 7 lines
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 <[email protected]>Signed-off-by Robin Jarry <[email protected]>
Was applied quickly to fix the build.