From e6a25e7e0b56ae7ebe6f2cb5258c9393bdf55c93 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 13 Mar 2025 14:41:16 +0100 Subject: [PATCH] doc/conf.py: use "sphinx_rtd_theme" only if it is installed Don't fail at build time only because the RTD scheme is not installed. Such a problem should be detected at configure time. --- NEWS | 1 + doc/conf.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 814e30e01..696a88ad0 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.24.1 (not yet released) - sndio: fix rounding error in volume calculation * log: include year in time stamp * fix build failure in the "id3tag" Meson subproject +* doc: use "sphinx_rtd_theme" only if it is installed ver 0.24 (2025/03/11) * protocol diff --git a/doc/conf.py b/doc/conf.py index aa82a9545..d575143ea 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -105,6 +105,13 @@ todo_include_todos = False # html_theme = 'sphinx_rtd_theme' +try: + __import__(html_theme) +except ModuleNotFoundError: + import sys + print(f"Warning: Sphinx theme {html_theme!r} not available, falling back to the default theme", file=sys.stderr) + del html_theme + # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation.