diff --git a/src/doc/common/templates-furo/search.html b/src/doc/common/templates-furo/search.html
new file mode 100644
index 00000000000..c258a04389f
--- /dev/null
+++ b/src/doc/common/templates-furo/search.html
@@ -0,0 +1,70 @@
+{#-
+ The search page template modified from theme/basic/search.html
+-#}
+{% extends "page.html" %}
+
+{%- block regular_scripts -%}
+{{ super() }}
+
+
+{%- endblock regular_scripts-%}
+
+{%- block htmltitle -%}
+
{{ _("Search") }} - {{ docstitle }}
+{%- endblock htmltitle -%}
+
+{% block scripts -%}
+{{ super() }}
+
+{%- endblock scripts %}
+
+{% block content %}
+{{ _('Search') }}
+{% block scriptwarning %}
+
+{% endblock %}
+{% block searchtext %}
+
+ {% trans %}Searching for multiple words only shows matches that contain
+ all words.{% endtrans %}
+
+
+ {% trans %}Note also that you can also call "search_src(...)"
+ in Sage to search Sage's source code.{% endtrans %}
+
+{% endblock %}
+{% block searchbox %}
+
+{% endblock %}
+{% block searchresults %}
+ {% if search_performed %}
+ {{ _('Search Results') }}
+ {% if not search_results %}
+ {{ _('Your search did not match any documents.') }}
+ {% endif %}
+ {% endif %}
+
+ {% if search_results %}
+
+ {% for href, caption, context in search_results %}
+ - {{ caption }}
+
{{ context|e }}
+
+ {% endfor %}
+
+ {% endif %}
+
+{% endblock %}
+{% endblock %}
+
diff --git a/src/doc/common/templates/sidebar/brand.html b/src/doc/common/templates-furo/sidebar/brand.html
similarity index 90%
rename from src/doc/common/templates/sidebar/brand.html
rename to src/doc/common/templates-furo/sidebar/brand.html
index bbd7c8ad8c4..fd1d69324b2 100644
--- a/src/doc/common/templates/sidebar/brand.html
+++ b/src/doc/common/templates-furo/sidebar/brand.html
@@ -1,7 +1,5 @@
{#-
-
-This is a sidebar brand html modified from Furo's default theme/furo/sidebar/brand.html
-
+ The sidebar brand template modified from theme/furo/sidebar/brand.html
-#}
{% block brand_content %}
diff --git a/src/sage_docbuild/conf.py b/src/sage_docbuild/conf.py
index 32e3bc48e12..a1ed0477d0c 100644
--- a/src/sage_docbuild/conf.py
+++ b/src/sage_docbuild/conf.py
@@ -22,16 +22,17 @@
import sys
import os
import sphinx
-
-from sage.env import SAGE_DOC_SRC, SAGE_DOC, THEBE_DIR, PPLPY_DOCS, MATHJAX_DIR
-from sage.misc.latex_macros import sage_mathjax_macros
-import sage.version
-from sage.misc.sagedoc import extlinks
+import sphinx.ext.intersphinx as intersphinx
import dateutil.parser
+import sage.version
+
from sphinx import highlighting
-import sphinx.ext.intersphinx as intersphinx
from IPython.lib.lexers import IPythonConsoleLexer, IPyLexer
+from sage.misc.sagedoc import extlinks
+from sage.env import SAGE_DOC_SRC, SAGE_DOC, THEBE_DIR, PPLPY_DOCS, MATHJAX_DIR
+from sage.misc.latex_macros import sage_mathjax_macros
+from sage.features import PythonModule
# General configuration
# ---------------------
@@ -240,26 +241,24 @@ def set_intersphinx_mappings(app, config):
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [os.path.join(SAGE_DOC_SRC, "common", "themes")]
-if importlib.util.find_spec("furo") is not None:
+if PythonModule("furo").is_present():
+ # Sphinx theme "furo" does not permit an extension. Do not attempt to make
+ # a "sage-furo" theme.
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 = {
- # Hide project’s name in the sidebar of the documentation;
- # the logo is enough.
- # https://pradyunsg.me/furo/customisation/#sidebar-hide-name
- "sidebar_hide_name": False,
- # Change accent (used for stylising links, sidebar’s content etc)
"light_css_variables": {
"color-brand-primary": "#0f0fff",
"color-brand-content": "#0f0fff",
},
- # Add sage logo to sidebar
- # https://pradyunsg.me/furo/customisation/logo/#different-logos-for-light-and-dark-mode
"light_logo": "logo_sagemath_black.svg",
"dark_logo": "logo_sagemath.svg",
}
- # The name of the Pygments (syntax highlighting) style to use. NOTE: This
+ # The name of the Pygments (syntax highlighting) style to use. This
# overrides a HTML theme's corresponding setting.
pygments_style = "sphinx"
pygments_dark_style = "monokai"
@@ -269,15 +268,17 @@ def set_intersphinx_mappings(app, config):
html_css_files = [
'custom-furo.css',
]
+ # A list of paths that contain extra templates (or templates that overwrite
+ # builtin/theme-specific templates). Relative paths are taken as relative
+ # to the configuration directory.
+ templates_path = [os.path.join(SAGE_DOC_SRC, 'common', 'templates-furo')] + templates_path
else:
- # Sage default HTML theme. We use a custom theme to set a Pygments style,
- # stylesheet, and insert MathJax macros. See the directory
- # doc/common/themes/sage-classic/ for files comprising the custom theme.
+ # Sage default Sphinx theme.
+ #
+ # See the directory doc/common/themes/sage-classic/ for files comprising
+ # the custom theme.
html_theme = "sage-classic"
- # 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 = {}
# HTML style sheet NOTE: This overrides a HTML theme's corresponding