From a9feded4d98ca5e86554dbbe589b98808e4467df Mon Sep 17 00:00:00 2001 From: Michael Goerz Date: Tue, 4 Jun 2024 13:16:45 -0400 Subject: [PATCH] Fix version menu --- docs/conf.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 946cf8f..e016942 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -210,12 +210,18 @@ def patched_parse(self): # -- Options for HTML output --------------------------------------------------- +# on_rtd is whether we are on readthedocs.org, this line of code grabbed from +# docs.readthedocs.org +on_rtd = os.environ.get("READTHEDOCS", None) == "True" + # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -import sphinx_rtd_theme -html_theme = "sphinx_rtd_theme" -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] -#html_theme = 'sphinxdoc' +if not on_rtd: # only import and set the theme if we're building docs locally + import sphinx_rtd_theme + + html_theme = "sphinx_rtd_theme" + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +# html_theme = 'sphinxdoc' # 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 @@ -290,6 +296,8 @@ def patched_parse(self): # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None + +docs_versions_menu_conf = {'menu_title': 'Docs'} nbsphinx_prolog = r""" {% set docname = env.doc2path(env.docname, base='docs') %}