Skip to content

Commit 7a937a7

Browse files
committed
Code formatting
1 parent b90f884 commit 7a937a7

File tree

5 files changed

+120
-107
lines changed

5 files changed

+120
-107
lines changed

docs/source/_templates/__init__.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from sphinx.util.logging import getLogger
1414

1515

16-
__version__ = '1.0.0'
16+
__version__ = "1.0.0"
1717
__version_full__ = __version__
1818

1919
logger = getLogger(__name__)
@@ -27,38 +27,45 @@ def get_html_theme_path():
2727

2828
def config_initiated(app, config):
2929
theme_options = config.html_theme_options or {}
30-
if theme_options.get('canonical_url'):
30+
if theme_options.get("canonical_url"):
3131
logger.warning(
32-
_('The canonical_url option is deprecated, use the html_baseurl option from Sphinx instead.')
32+
_(
33+
"The canonical_url option is deprecated, use the html_baseurl option from Sphinx instead."
34+
)
3335
)
3436

37+
3538
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
3639
def setup(app):
3740
if python_version[0] < 3:
38-
logger.warning("Python 2 is deprecated with sphinx_rtd_theme, update to Python 3")
39-
app.require_sphinx('1.6')
41+
logger.warning(
42+
"Python 2 is deprecated with sphinx_rtd_theme, update to Python 3"
43+
)
44+
app.require_sphinx("1.6")
4045
if sphinx_version <= (2, 0, 0):
41-
logger.warning("Sphinx 1.x is deprecated with sphinx_rtd_theme, update to Sphinx 2.x or greater")
46+
logger.warning(
47+
"Sphinx 1.x is deprecated with sphinx_rtd_theme, update to Sphinx 2.x or greater"
48+
)
4249
if not app.config.html_experimental_html5_writer:
4350
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
4451
else:
4552
if app.config.html4_writer:
4653
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
4754

4855
# Register the theme that can be referenced without adding a theme path
49-
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
56+
app.add_html_theme("sphinx_rtd_theme", path.abspath(path.dirname(__file__)))
5057

5158
if sphinx_version >= (1, 8, 0):
5259
# Add Sphinx message catalog for newer versions of Sphinx
5360
# See http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_message_catalog
54-
rtd_locale_path = path.join(path.abspath(path.dirname(__file__)), 'locale')
55-
app.add_message_catalog('sphinx', rtd_locale_path)
56-
app.connect('config-inited', config_initiated)
61+
rtd_locale_path = path.join(path.abspath(path.dirname(__file__)), "locale")
62+
app.add_message_catalog("sphinx", rtd_locale_path)
63+
app.connect("config-inited", config_initiated)
5764

5865
# sphinx emits the permalink icon for headers, so choose one more in keeping with our theme
5966
if sphinx_version >= (3, 5, 0):
6067
app.config.html_permalinks_icon = "\uf0c1"
6168
else:
6269
app.config.html_add_permalinks = "\uf0c1"
6370

64-
return {'parallel_read_safe': True, 'parallel_write_safe': True}
71+
return {"parallel_read_safe": True, "parallel_write_safe": True}

docs/source/_templates/footer.html

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,67 @@
11
<footer>
2-
{%- if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
3-
{#- Translators: This is an ARIA section label for the footer section of the page. -#}
4-
<div class="rst-footer-buttons" role="navigation" aria-label="{{ _('Footer') }}">
5-
{%- if prev %}
6-
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
7-
{%- endif %}
8-
{%- if next %}
9-
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n" rel="next">{{ _('Next') }} <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
10-
{%- endif %}
11-
</div>
2+
{%- if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev)
3+
%}
4+
{#- Translators: This is an ARIA section label for the footer section of the page. -#}
5+
<div class="rst-footer-buttons" role="navigation" aria-label="{{ _('Footer') }}">
6+
{%- if prev %}
7+
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p"
8+
rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
9+
{%- endif %}
10+
{%- if next %}
11+
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n"
12+
rel="next">{{ _('Next') }} <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
13+
{%- endif %}
14+
</div>
1215
{%- endif %}
1316

14-
<hr/>
17+
<hr />
1518

1619
<div role="contentinfo">
17-
{%- block contentinfo %}
20+
{%- block contentinfo %}
1821
<p>
19-
{%- if show_copyright %}
22+
{%- if show_copyright %}
2023
{%- if hasdoc('copyright') %}
21-
{%- trans path=pathto('copyright'), copyright=copyright|e %}&#169; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
24+
{%- trans path=pathto('copyright'), copyright=copyright|e %}&#169; <a href="{{ path }}">Copyright</a> {{ copyright
25+
}}.{% endtrans %}
2226
{%- else %}
23-
{%- trans copyright=copyright|e %}&#169; Copyright {{ copyright }}.{% endtrans %}
27+
{%- trans copyright=copyright|e %}&#169; Copyright {{ copyright }}.{% endtrans %}
28+
{%- endif %}
2429
{%- endif %}
25-
{%- endif %}
2630

27-
{%- if build_id and build_url %}
31+
{%- if build_id and build_url %}
2832
<span class="build">
2933
{#- Translators: Build is a noun, not a verb -#}
3034
{%- trans %}Build{% endtrans -%}
3135
<a href="{{ build_url }}">{{ build_id }}</a>.
3236
</span>
33-
{%- elif commit %}
37+
{%- elif commit %}
3438
<span class="commit">
3539
{#- Translators: the phrase "revision" comes from Git, referring to a commit #}
3640
{%- trans %}Revision{% endtrans %} <code>{{ commit }}</code>.
3741
</span>
38-
{%- endif %}
39-
{%- if last_updated %}
42+
{%- endif %}
43+
{%- if last_updated %}
4044
<span class="lastupdated">
4145
{%- trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
4246
</span>
43-
{%- endif -%}
47+
{%- endif -%}
4448

4549
</p>
46-
{%- endblock %}
50+
{%- endblock %}
4751
</div>
4852

4953
{% if show_sphinx %}
50-
{%- set sphinx_web = '<a href="https://www.sphinx-doc.org/">Sphinx</a>' %}
51-
{%- set readthedocs_web = '<a href="https://readthedocs.org">Read the Docs</a>' %}
52-
{#- Translators: the variable "sphinx_web" is a link to the Sphinx project documentation with the text "Sphinx" #}
53-
{%- trans sphinx_web=sphinx_web, readthedocs_web=readthedocs_web %}Built with {{ sphinx_web }} using a{% endtrans %}
54-
{#- Translators: "theme" refers to a theme for Sphinx, which alters the appearance of the generated documenation #}
55-
<a href="https://github.com/readthedocs/sphinx_rtd_theme">{% trans %}theme{% endtrans %}</a>
56-
{#- Translators: this is always used as "provided by Read the Docs", and should not imply Read the Docs is an author of the generated documentation. #}
57-
{% trans %}provided by {{ readthedocs_web }}{% endtrans %}.
54+
{%- set sphinx_web = '<a href="https://www.sphinx-doc.org/">Sphinx</a>' %}
55+
{%- set readthedocs_web = '<a href="https://readthedocs.org">Read the Docs</a>' %}
56+
{#- Translators: the variable "sphinx_web" is a link to the Sphinx project documentation with the text "Sphinx" #}
57+
{%- trans sphinx_web=sphinx_web, readthedocs_web=readthedocs_web %}Built with {{ sphinx_web }} using a{% endtrans %}
58+
{#- Translators: "theme" refers to a theme for Sphinx, which alters the appearance of the generated documenation #}
59+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">{% trans %}theme{% endtrans %}</a>
60+
{#- Translators: this is always used as "provided by Read the Docs", and should not imply Read the Docs is an author
61+
of the generated documentation. #}
62+
{% trans %}provided by {{ readthedocs_web }}{% endtrans %}.
5863
{% endif %}
5964

6065
{%- block extrafooter %} {% endblock %}
6166

62-
</footer>
67+
</footer>

docs/source/_templates/search.html

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,57 @@
11
{#
2-
basic/search.html
3-
~~~~~~~~~~~~~~~~~
2+
basic/search.html
3+
~~~~~~~~~~~~~~~~~
44

5-
Template for the search page.
5+
Template for the search page.
66

7-
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see https://github.com/sphinx-doc/sphinx/blob/master/LICENSE for details.
7+
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
8+
:license: BSD, see https://github.com/sphinx-doc/sphinx/blob/master/LICENSE for details.
99
#}
1010
{%- extends "layout.html" %}
1111
{% set title = _('Search') %}
1212
{% set display_vcs_links = False %}
1313
{%- block scripts %}
14-
{{ super() }}
15-
<script src="{{ pathto('_static/searchtools.js', 1) }}"></script>
16-
<script src="{{ pathto('_static/language_data.js', 1) }}"></script>
14+
{{ super() }}
15+
<script src="{{ pathto('_static/searchtools.js', 1) }}"></script>
16+
<script src="{{ pathto('_static/language_data.js', 1) }}"></script>
1717
{%- endblock %}
1818
{% block footer %}
19-
<script>
20-
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
21-
</script>
22-
{# this is used when loading the search index using $.ajax fails,
23-
such as on Chrome for documents on localhost #}
24-
<script id="searchindexloader"></script>
25-
{{ super() }}
19+
<script>
20+
jQuery(function () { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
21+
</script>
22+
{# this is used when loading the search index using $.ajax fails,
23+
such as on Chrome for documents on localhost #}
24+
<script id="searchindexloader"></script>
25+
{{ super() }}
2626
{% endblock %}
2727
{% block body %}
28-
<noscript>
28+
<noscript>
2929
<div id="fallback" class="admonition warning">
3030
<p class="last">
3131
{% trans trimmed %}Please activate JavaScript to enable the search
3232
functionality.{% endtrans %}
3333
</p>
3434
</div>
35-
</noscript>
35+
</noscript>
3636

37-
{% if search_performed %}
38-
{# Translators: Search is a noun, not a verb #}
39-
<h2>{{ _('Search Results') }}</h2>
40-
{% if not search_results %}
41-
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p>
42-
{% endif %}
43-
{% endif %}
44-
<div id="search-results">
37+
{% if search_performed %}
38+
{# Translators: Search is a noun, not a verb #}
39+
<h2>{{ _('Search Results') }}</h2>
40+
{% if not search_results %}
41+
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve
42+
selected enough categories.') }}</p>
43+
{% endif %}
44+
{% endif %}
45+
<div id="search-results">
4546
{% if search_results %}
46-
<ul>
47+
<ul>
4748
{% for href, caption, context in search_results %}
48-
<li>
49-
<a href="{{ pathto(item.href) }}">{{ caption }}</a>
50-
<p class="context">{{ context|e }}</p>
51-
</li>
49+
<li>
50+
<a href="{{ pathto(item.href) }}">{{ caption }}</a>
51+
<p class="context">{{ context|e }}</p>
52+
</li>
5253
{% endfor %}
53-
</ul>
54+
</ul>
5455
{% endif %}
55-
</div>
56-
{% endblock %}
56+
</div>
57+
{% endblock %}

docs/source/_templates/searchbox.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
<input type="hidden" name="area" value="default" />
77
</form>
88
</div>
9-
{%- endif %}
9+
{%- endif %}
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
{% if READTHEDOCS %}
22
{# Add rst-badge after rst-versions for small badge style. #}
3-
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Versions') }}">
4-
<span class="rst-current-version" data-toggle="rst-current-version">
5-
<span class="fa fa-book"> Read the Docs</span>
6-
v: {{ current_version }}
7-
<span class="fa fa-caret-down"></span>
8-
</span>
9-
<div class="rst-other-versions">
10-
<dl>
11-
<dt>{{ _('Versions') }}</dt>
12-
{% for slug, url in versions %}
13-
<dd><a href="{{ url }}">{{ slug }}</a></dd>
14-
{% endfor %}
15-
</dl>
16-
<dl>
17-
<dt>{{ _('Downloads') }}</dt>
18-
{% for type, url in downloads %}
19-
<dd><a href="{{ url }}">{{ type }}</a></dd>
20-
{% endfor %}
21-
</dl>
22-
<dl>
23-
{# Translators: The phrase "Read the Docs" is not translated #}
24-
<dt>{{ _('On Read the Docs') }}</dt>
25-
<dd>
26-
<a href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}/?fromdocs={{ slug }}">{{ _('Project Home') }}</a>
27-
</dd>
28-
<dd>
29-
<a href="//{{ PRODUCTION_DOMAIN }}/builds/{{ slug }}/?fromdocs={{ slug }}">{{ _('Builds') }}</a>
30-
</dd>
31-
</dl>
32-
</div>
3+
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Versions') }}">
4+
<span class="rst-current-version" data-toggle="rst-current-version">
5+
<span class="fa fa-book"> Read the Docs</span>
6+
v: {{ current_version }}
7+
<span class="fa fa-caret-down"></span>
8+
</span>
9+
<div class="rst-other-versions">
10+
<dl>
11+
<dt>{{ _('Versions') }}</dt>
12+
{% for slug, url in versions %}
13+
<dd><a href="{{ url }}">{{ slug }}</a></dd>
14+
{% endfor %}
15+
</dl>
16+
<dl>
17+
<dt>{{ _('Downloads') }}</dt>
18+
{% for type, url in downloads %}
19+
<dd><a href="{{ url }}">{{ type }}</a></dd>
20+
{% endfor %}
21+
</dl>
22+
<dl>
23+
{# Translators: The phrase "Read the Docs" is not translated #}
24+
<dt>{{ _('On Read the Docs') }}</dt>
25+
<dd>
26+
<a href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}/?fromdocs={{ slug }}">{{ _('Project Home') }}</a>
27+
</dd>
28+
<dd>
29+
<a href="//{{ PRODUCTION_DOMAIN }}/builds/{{ slug }}/?fromdocs={{ slug }}">{{ _('Builds') }}</a>
30+
</dd>
31+
</dl>
3332
</div>
34-
{% endif %}
33+
</div>
34+
{% endif %}

0 commit comments

Comments
 (0)