Switch documentation theme to Furo

This commit is contained in:
Pradyun Gedam 2022-03-18 17:27:35 +00:00
parent 22756c28e5
commit cfad472782
No known key found for this signature in database
GPG Key ID: FF99710C4332258E
8 changed files with 7 additions and 162 deletions

View File

@ -1,34 +0,0 @@
<h3>Contents</h3>
<ul>
<li><a href="{{ pathto('index') }}">Home</a></li>
<li><a href="{{ pathto('getting-started') }}">Get started</a></li>
<li><a href="{{ pathto('how-to/index') }}">How-to guides</a></li>
<li><a href="{{ pathto('reference/index') }}">Reference guides</a></li>
<li><a href="{{ pathto('explanation/index') }}">Explanation</a></li>
<li><a href="{{ pathto('contents') }}">Complete table of contents</a></li>
<li><a href="{{ pathto('example/index') }}">Library of examples</a></li>
</ul>
<h3>About the project</h3>
<ul>
<li><a href="{{ pathto('changelog') }}">Changelog</a></li>
<li><a href="{{ pathto('contributing') }}">Contributing</a></li>
<li><a href="{{ pathto('backwards-compatibility') }}">Backwards Compatibility</a></li>
<li><a href="{{ pathto('py27-py34-deprecation') }}">Python 2.7 and 3.4 Support</a></li>
<li><a href="{{ pathto('sponsor') }}">Sponsor</a></li>
<li><a href="{{ pathto('tidelift') }}">pytest for Enterprise</a></li>
<li><a href="{{ pathto('license') }}">License</a></li>
<li><a href="{{ pathto('contact') }}">Contact Channels</a></li>
</ul>
{%- if display_toc %}
<hr>
{{ toc }}
{%- endif %}
<hr>
<a href="{{ pathto('genindex') }}">Index</a>
<hr>

View File

@ -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 }}
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- endset %}
{% block extrahead %}
{%- if page_canonical_url %}
<link rel="canonical" href="{{ page_canonical_url }}">
{%- endif %}
<script>DOCUMENTATION_OPTIONS.URL_ROOT = '{{ url_root }}';</script>
{{ super() }}
{%- endblock %}
{% block sidebarlogo %}
{% if pagename != "index" or theme_index_sidebar_logo %}
{{ super() }}
{% endif %}
{% endblock %}
{% block relbar2 %}{% endblock %}
{% block sidebar2 %}
<span id="sidebar-top"></span>
{{- super() }}
{%- endblock %}
{% block footer %}
{{ super() }}
{%- if READTHEDOCS and not readthedocs_docsearch %}
<script>
if (typeof READTHEDOCS_DATA !== 'undefined') {
if (!READTHEDOCS_DATA.features) {
READTHEDOCS_DATA.features = {};
}
READTHEDOCS_DATA.features.docsearch_disabled = true;
}
</script>
{%- endif %}
{{ js_tag("_static/version_warning_offset.js") }}
{% endblock %}

View File

@ -1,7 +0,0 @@
<h3>Useful Links</h3>
<ul>
<li><a href="https://pypi.org/project/pytest/">pytest @ PyPI</a></li>
<li><a href="https://github.com/pytest-dev/pytest/">pytest @ GitHub</a></li>
<li><a href="https://github.com/pytest-dev/pytest/issues">Issue Tracker</a></li>
<li><a href="https://media.readthedocs.org/pdf/pytest/latest/pytest.pdf">PDF Documentation</a>
</ul>

View File

@ -1,19 +0,0 @@
<h3>Related Topics</h3>
<ul>
<li><a href="{{ pathto(master_doc) }}">Documentation overview</a><ul>
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}">{{ parent.title }}</a><ul>
{%- endfor %}
{%- if prev %}
<li>Previous: <a href="{{ prev.link|e }}" title="{{ _('previous chapter')
}}">{{ prev.title }}</a></li>
{%- endif %}
{%- if next %}
<li>Next: <a href="{{ next.link|e }}" title="{{ _('next chapter')
}}">{{ next.title }}</a></li>
{%- endif %}
{%- for parent in parents %}
</ul></li>
{%- endfor %}
</ul></li>
</ul>

View File

@ -1,5 +0,0 @@
<h3>About pytest</h3>
<p>
pytest is a mature full-featured Python testing tool that helps
you write better programs.
</p>

View File

@ -1,15 +0,0 @@
{#
basic/searchbox.html with heading removed.
#}
{%- if pagename != "search" and builder != "singlehtml" %}
<div id="searchbox" style="display: none" role="search">
<div class="searchformwrapper">
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" aria-labelledby="searchlabel"
placeholder="Search"/>
<input type="submit" value="{{ _('Go') }}" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
{%- endif %}

View File

@ -16,9 +16,7 @@
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
# The short X.Y version. # The short X.Y version.
import ast import ast
import os
import shutil import shutil
import sys
from textwrap import dedent from textwrap import dedent
from typing import List from typing import List
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
@ -65,7 +63,6 @@ latex_elements = {
# Add any Sphinx extension module names here, as strings. They can be extensions # Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [ extensions = [
"pallets_sphinx_themes",
"pygments_pytest", "pygments_pytest",
"sphinx.ext.autodoc", "sphinx.ext.autodoc",
"sphinx.ext.autosummary", "sphinx.ext.autosummary",
@ -141,7 +138,7 @@ add_module_names = False
# show_authors = False # show_authors = False
# The name of the Pygments (syntax highlighting) style to use. # 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. # A list of ignored prefixes for module index sorting.
@ -172,17 +169,14 @@ extlinks = {
# -- Options for HTML output --------------------------------------------------- # -- 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 # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # 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 # 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 # further. For a list of options available for each theme, see the
# documentation. # 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. # Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = [] # html_theme_path = []
@ -218,24 +212,6 @@ html_favicon = "img/favicon.png"
# Custom sidebar templates, maps document names to template names. # Custom sidebar templates, maps document names to template names.
# html_sidebars = {} # 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 # Additional templates that should be rendered to pages, maps page names to
# template names. # template names.
@ -395,9 +371,10 @@ intersphinx_mapping = {
def configure_logging(app: "sphinx.application.Sphinx") -> None: def configure_logging(app: "sphinx.application.Sphinx") -> None:
"""Configure Sphinx's WarningHandler to handle (expected) missing include.""" """Configure Sphinx's WarningHandler to handle (expected) missing include."""
import sphinx.util.logging
import logging import logging
import sphinx.util.logging
class WarnLogFilter(logging.Filter): class WarnLogFilter(logging.Filter):
def filter(self, record: logging.LogRecord) -> bool: def filter(self, record: logging.LogRecord) -> bool:
"""Ignore warnings about missing include with "only" directive. """Ignore warnings about missing include with "only" directive.

View File

@ -1,7 +1,7 @@
pallets-sphinx-themes furo
pluggy>=1.0 pluggy>=1.0
pygments-pytest>=2.2.0 pygments-pytest>=2.2.0
sphinx-removed-in>=0.2.0 sphinx-removed-in>=0.2.0
sphinx>=3.1,<4 sphinx>4,<4.4
sphinxcontrib-trio sphinxcontrib-trio
sphinxcontrib-svg2pdfconverter sphinxcontrib-svg2pdfconverter