From c3040463849eb9b3e5f85706bb223d648e60510d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 4 Sep 2025 11:39:24 -0500 Subject: [PATCH] docs: Always use sphinx_rtd_theme. Without this, the wy-alert block pushed all the content to the right, making the locally built pages nearly illegible. Signed-off-by: Jeff Epler --- docs/conf.py | 16 +++------------- docs/requirements.txt | 1 + 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index eb61487582..603543aa18 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,6 +55,7 @@ extensions = [ "sphinx.ext.todo", "sphinx.ext.coverage", "sphinxcontrib.jquery", + "sphinx_rtd_theme", ] # Add any paths that contain templates here, relative to this directory. @@ -128,20 +129,9 @@ rst_epilog = """ # -- Options for HTML output ---------------------------------------------- -# on_rtd is whether we are on readthedocs.org -on_rtd = os.environ.get("READTHEDOCS", None) == "True" +import sphinx_rtd_theme -if not on_rtd: # only import and set the theme if we're building docs locally - try: - import sphinx_rtd_theme - - html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."] - except: - html_theme = "default" - html_theme_path = ["."] -else: - html_theme_path = ["."] +html_theme = "sphinx_rtd_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 diff --git a/docs/requirements.txt b/docs/requirements.txt index 824e9799c7..4d9b955857 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ sphinx~=7.2.6 sphinxcontrib.jquery==4.1 +sphinx-rtd-theme==3.0.2