diff --git a/doc/requirements.txt b/doc/requirements.txt index f27bf9293a..e856e2724f 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,3 +6,4 @@ reno>=3.4.0 # Apache-2.0 sphinx>=4.2.0 # BSD sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD Sphinx-Substitution-Extensions # Apache-2.0 +sphinx-immaterial # MIT diff --git a/doc/source/conf.py b/doc/source/conf.py index 7d9e69d862..09bc98eb98 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -52,6 +52,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ + 'sphinx_immaterial', 'reno.sphinxext', #'sphinx.ext.autodoc', 'sphinx.ext.extlinks', @@ -88,7 +89,7 @@ # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = [] -html_theme = 'default' +html_theme = 'sphinx_immaterial' # html_static_path = ['static'] # Add any paths that contain "extra" files, such as .htaccess or @@ -96,7 +97,34 @@ # html_extra_path = ['_extra'] html_theme_options = { - # "show_other_versions": True, + "palette": [ + + { + "media": "(prefers-color-scheme: light)", + "scheme": "default", + "toggle": { + "icon": "material/weather-sunny", + "name": "Switch to dark mode", + } + }, + { + "media": "(prefers-color-scheme: dark)", + "scheme": "slate", + "toggle": { + "icon": "material/weather-night", + "name": "Switch to system preference", + } + }, + ], + "features": [ + "navigation.expand", + "navigation.top", + "navigation.footer", + "search.suggest", + "content.code.copy", + "toc.follow", + "toc.sticky", + ] } # Output file base name for HTML help builder.