From cfad472782df8f98d223492eb1e3a0459a29f50c Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 18 Mar 2022 17:27:35 +0000 Subject: [PATCH] Switch documentation theme to Furo --- doc/en/_templates/globaltoc.html | 34 ------------------ doc/en/_templates/layout.html | 52 --------------------------- doc/en/_templates/links.html | 7 ---- doc/en/_templates/relations.html | 19 ---------- doc/en/_templates/sidebarintro.html | 5 --- doc/en/_templates/slim_searchbox.html | 15 -------- doc/en/conf.py | 33 +++-------------- doc/en/requirements.txt | 4 +-- 8 files changed, 7 insertions(+), 162 deletions(-) delete mode 100644 doc/en/_templates/globaltoc.html delete mode 100644 doc/en/_templates/layout.html delete mode 100644 doc/en/_templates/links.html delete mode 100644 doc/en/_templates/relations.html delete mode 100644 doc/en/_templates/sidebarintro.html delete mode 100644 doc/en/_templates/slim_searchbox.html diff --git a/doc/en/_templates/globaltoc.html b/doc/en/_templates/globaltoc.html deleted file mode 100644 index 7c595e7eb..000000000 --- a/doc/en/_templates/globaltoc.html +++ /dev/null @@ -1,34 +0,0 @@ -

Contents

- - - -

About the project

- - - -{%- if display_toc %} -
- {{ toc }} -{%- endif %} - -
-Index -
diff --git a/doc/en/_templates/layout.html b/doc/en/_templates/layout.html deleted file mode 100644 index f7096eaaa..000000000 --- a/doc/en/_templates/layout.html +++ /dev/null @@ -1,52 +0,0 @@ -{# - - Copied from: - - https://raw.githubusercontent.com/pallets/pallets-sphinx-themes/b0c6c41849b4e15cbf62cc1d95c05ef2b3e155c8/src/pallets_sphinx_themes/themes/pocoo/layout.html - - And removed the warning version (see #7331). - -#} - -{% extends "basic/layout.html" %} - -{% set metatags %} - {{- metatags }} - -{%- endset %} - -{% block extrahead %} - {%- if page_canonical_url %} - - {%- endif %} - - {{ super() }} -{%- endblock %} - -{% block sidebarlogo %} - {% if pagename != "index" or theme_index_sidebar_logo %} - {{ super() }} - {% endif %} -{% endblock %} - -{% block relbar2 %}{% endblock %} - -{% block sidebar2 %} - - {{- super() }} -{%- endblock %} - -{% block footer %} - {{ super() }} - {%- if READTHEDOCS and not readthedocs_docsearch %} - - {%- endif %} - {{ js_tag("_static/version_warning_offset.js") }} -{% endblock %} diff --git a/doc/en/_templates/links.html b/doc/en/_templates/links.html deleted file mode 100644 index c253ecabf..000000000 --- a/doc/en/_templates/links.html +++ /dev/null @@ -1,7 +0,0 @@ -

Useful Links

- diff --git a/doc/en/_templates/relations.html b/doc/en/_templates/relations.html deleted file mode 100644 index 3bbcde85b..000000000 --- a/doc/en/_templates/relations.html +++ /dev/null @@ -1,19 +0,0 @@ -

Related Topics

- diff --git a/doc/en/_templates/sidebarintro.html b/doc/en/_templates/sidebarintro.html deleted file mode 100644 index ae860c172..000000000 --- a/doc/en/_templates/sidebarintro.html +++ /dev/null @@ -1,5 +0,0 @@ -

About pytest

-

- pytest is a mature full-featured Python testing tool that helps - you write better programs. -

diff --git a/doc/en/_templates/slim_searchbox.html b/doc/en/_templates/slim_searchbox.html deleted file mode 100644 index e98ad4ed9..000000000 --- a/doc/en/_templates/slim_searchbox.html +++ /dev/null @@ -1,15 +0,0 @@ -{# - basic/searchbox.html with heading removed. -#} -{%- if pagename != "search" and builder != "singlehtml" %} - - -{%- endif %} diff --git a/doc/en/conf.py b/doc/en/conf.py index 1adc3493a..c1d198c1c 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -16,9 +16,7 @@ # The full version, including alpha/beta/rc tags. # The short X.Y version. import ast -import os import shutil -import sys from textwrap import dedent from typing import List from typing import TYPE_CHECKING @@ -65,7 +63,6 @@ latex_elements = { # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ - "pallets_sphinx_themes", "pygments_pytest", "sphinx.ext.autodoc", "sphinx.ext.autosummary", @@ -141,7 +138,7 @@ add_module_names = False # show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" +# pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. @@ -172,17 +169,14 @@ extlinks = { # -- Options for HTML output --------------------------------------------------- -sys.path.append(os.path.abspath("_themes")) -html_theme_path = ["_themes"] - # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = "flask" +html_theme = "furo" # 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 = {"index_logo": None} +html_theme_options = {"sidebar_hide_name": True} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] @@ -218,24 +212,6 @@ html_favicon = "img/favicon.png" # Custom sidebar templates, maps document names to template names. # html_sidebars = {} -# html_sidebars = {'index': 'indexsidebar.html'} - -html_sidebars = { - "index": [ - "slim_searchbox.html", - "sidebarintro.html", - "globaltoc.html", - "links.html", - "sourcelink.html", - ], - "**": [ - "slim_searchbox.html", - "globaltoc.html", - "relations.html", - "links.html", - "sourcelink.html", - ], -} # Additional templates that should be rendered to pages, maps page names to # template names. @@ -395,9 +371,10 @@ intersphinx_mapping = { def configure_logging(app: "sphinx.application.Sphinx") -> None: """Configure Sphinx's WarningHandler to handle (expected) missing include.""" - import sphinx.util.logging import logging + import sphinx.util.logging + class WarnLogFilter(logging.Filter): def filter(self, record: logging.LogRecord) -> bool: """Ignore warnings about missing include with "only" directive. diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index 5b49cb7fc..534b77a95 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -1,7 +1,7 @@ -pallets-sphinx-themes +furo pluggy>=1.0 pygments-pytest>=2.2.0 sphinx-removed-in>=0.2.0 -sphinx>=3.1,<4 +sphinx>4,<4.4 sphinxcontrib-trio sphinxcontrib-svg2pdfconverter