diff --git a/doc/readthedocs_requirements.txt b/doc/readthedocs_requirements.txt index d93014710..ca4b4e69b 100644 --- a/doc/readthedocs_requirements.txt +++ b/doc/readthedocs_requirements.txt @@ -6,3 +6,4 @@ -r ../test-requirements.txt -r ../extra-requirements.txt -r ./requirements.txt +sphinx_rtd_theme>=0.5.1 # MIT diff --git a/doc/requirements.txt b/doc/requirements.txt index 3dee1be8a..70f78ad10 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,4 +4,3 @@ reno>=3.2.0 # Apache-2.0 sphinx>=3.4.2 # BSD -sphinx_rtd_theme>=0.5.1 # MIT diff --git a/doc/source/conf.py b/doc/source/conf.py index ef695d13a..58134afa0 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -97,7 +97,11 @@ todo_include_todos = True # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = "sphinx_rtd_theme" +try: + import sphinx_rtd_theme + html_theme = "sphinx_rtd_theme" +except ModuleNotFoundError: + html_theme = 'alabaster' # 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/releasenotes/source/conf.py b/releasenotes/source/conf.py index 2d1dd5c7c..8610bd927 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -81,7 +81,7 @@ master_doc = 'index' # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -97,25 +97,28 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = "sphinx_rtd_theme" +try: + import sphinx_rtd_theme + 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 + # documentation. + html_theme_options = { + "logo_only": False, + "display_version": True, + "prev_next_buttons_location": "top", + "style_external_links": True, + # Toc options + "collapse_navigation": True, + "sticky_navigation": True, + "navigation_depth": 4, + "includehidden": True, + "titles_only": False, + } +except ModuleNotFoundError: + html_theme = 'alabaster' + html_theme_options = {} -# 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. -# -html_theme_options = { - "canonical_url": "https://docs.openstack.org/tobiko/latest/", - "logo_only": False, - "display_version": True, - "prev_next_buttons_location": "top", - "style_external_links": True, - # Toc options - "collapse_navigation": True, - "sticky_navigation": True, - "navigation_depth": 4, - "includehidden": True, - "titles_only": False, -} # Add any paths that contain custom static files (such as style sheets) here,