Skip to content

Commit 8f6fc1a

Browse files
committed
Update Sphinx theme
1 parent 944ccf8 commit 8f6fc1a

35 files changed

Lines changed: 1319 additions & 13020 deletions

docs/.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
3.6.0
1+
3.9
22

docs/source/_themes/asc-basic/defindex.html

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
{#
2-
basic/defindex.html
3-
~~~~~~~~~~~~~~~~~~~
4-
5-
Default template for the "index" page.
6-
7-
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see LICENSE for details.
1+
{# Default template for the "index" page.
92
#}{{ warn('Now base template defindex.html is deprecated.') }}
103
{%- extends "layout.html" %}
114
{% set title = _('Overview') %}

docs/source/_themes/asc-basic/domainindex.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
{#
2-
basic/domainindex.html
3-
~~~~~~~~~~~~~~~~~~~~~~
4-
5-
Template for domain indices (module index, ...).
6-
7-
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see LICENSE for details.
9-
#}
1+
{# Template for domain indices (module index, ...). #}
102
{%- extends "layout.html" %}
113
{% set title = indextitle %}
124
{% block extrahead %}

docs/source/_themes/asc-basic/genindex-single.html

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
{#
2-
basic/genindex-single.html
3-
~~~~~~~~~~~~~~~~~~~~~~~~~~
4-
5-
Template for a "single" page of a split index.
6-
7-
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see LICENSE for details.
9-
#}
1+
{# Template for a "single" page of a split index. #}
102
{% macro indexentries(firstname, links) %}
113
{%- if links -%}
124
<a href="{{ links[0][1] }}">
@@ -30,7 +22,8 @@
3022
{% set title = _('Index') %}
3123
{% block body %}
3224

33-
<h1 id="index">{% trans key=key %}Index &ndash; {{ key }}{% endtrans %}</h1>
25+
{# We use ``&#x2013;`` instead of ``&ndash;`` for XHTML compatibility #}
26+
<h1 id="index">{% trans key=key %}Index &#x2013; {{ key }}{% endtrans %}</h1>
3427

3528
<table style="width: 100%" class="indextable"><tr>
3629
{%- for column in entries|slice(2) if column %}

docs/source/_themes/asc-basic/genindex-split.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
{#
2-
basic/genindex-split.html
3-
~~~~~~~~~~~~~~~~~~~~~~~~~
4-
5-
Template for a "split" index overview page.
6-
7-
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see LICENSE for details.
9-
#}
1+
{# Template for a "split" index overview page. #}
102
{%- extends "layout.html" %}
113
{% set title = _('Index') %}
124
{% block body %}

docs/source/_themes/asc-basic/genindex.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
{#
2-
basic/genindex.html
3-
~~~~~~~~~~~~~~~~~~~
4-
5-
Template for an "all-in-one" index.
6-
7-
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see LICENSE for details.
9-
#}
1+
{# Template for an "all-in-one" index. #}
102
{%- extends "layout.html" %}
113
{% set title = _('Index') %}
124

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
{#
2-
basic/globaltoc.html
3-
~~~~~~~~~~~~~~~~~~~~
4-
5-
Sphinx sidebar template: global table of contents.
6-
7-
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see LICENSE for details.
9-
#}
10-
<h3><a href="{{ pathto(master_doc)|e }}">{{ _('Table of Contents') }}</a></h3>
11-
{{ toctree(includehidden=theme_globaltoc_includehidden, collapse=theme_globaltoc_collapse) }}
1+
{# Sphinx sidebar template: global table of contents. #}
2+
<h3><a href="{{ pathto(root_doc)|e }}">{{ _('Table of Contents') }}</a></h3>
3+
{{ toctree(includehidden=theme_globaltoc_includehidden, collapse=theme_globaltoc_collapse, maxdepth=theme_globaltoc_maxdepth) }}

docs/source/_themes/asc-basic/layout.html

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
1-
{#
2-
basic/layout.html
3-
~~~~~~~~~~~~~~~~~
4-
5-
Master layout template for Sphinx themes.
6-
7-
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see LICENSE for details.
9-
#}
10-
{%- block doctype -%}{%- if html5_doctype %}
1+
{# Master layout template for Sphinx themes. #}
2+
{%- block doctype -%}
113
<!DOCTYPE html>
12-
{%- else %}
13-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
14-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
15-
{%- endif %}{%- endblock %}
4+
{%- endblock %}
165
{%- set reldelim1 = reldelim1 is not defined and ' &#187;' or reldelim1 %}
176
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
187
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
198
(sidebars != []) %}
20-
{%- set url_root = pathto('', 1) %}
21-
{# XXX necessary? #}
22-
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
9+
{# URL root should never be #, then all links are fragments #}
2310
{%- if not embedded and docstitle %}
2411
{%- set titlesuffix = " &#8212; "|safe + docstitle|e %}
2512
{%- else %}
2613
{%- set titlesuffix = "" %}
2714
{%- endif %}
2815

2916
{%- macro relbar() %}
30-
<div class="related" role="navigation" aria-label="related navigation">
17+
<div class="related" role="navigation" aria-label="Related">
3118
<h3>{{ _('Navigation') }}</h3>
3219
<ul>
3320
{%- for rellink in rellinks %}
@@ -37,7 +24,7 @@ <h3>{{ _('Navigation') }}</h3>
3724
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
3825
{%- endfor %}
3926
{%- block rootrellink %}
40-
<li class="nav-item nav-item-0"><a href="{{ pathto(master_doc)|e }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
27+
<li class="nav-item nav-item-0"><a href="{{ pathto(root_doc)|e }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
4128
{%- endblock %}
4229
{%- for parent in parents %}
4330
<li class="nav-item nav-item-{{ loop.index }}"><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
@@ -50,12 +37,12 @@ <h3>{{ _('Navigation') }}</h3>
5037

5138
{%- macro sidebar() %}
5239
{%- if render_sidebar %}
53-
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
40+
<div class="sphinxsidebar" role="navigation" aria-label="Main">
5441
<div class="sphinxsidebarwrapper">
5542
{%- block sidebarlogo %}
56-
{%- if logo %}
57-
<p class="logo"><a href="{{ pathto(master_doc)|e }}">
58-
<img class="logo" src="{{ pathto('_static/' + logo, 1)|e }}" alt="Logo"/>
43+
{%- if logo_url %}
44+
<p class="logo"><a href="{{ pathto(root_doc)|e }}">
45+
<img class="logo" src="{{ logo_url|e }}" alt="{{ logo_alt|e }}"/>
5946
</a></p>
6047
{%- endif %}
6148
{%- endblock %}
@@ -75,28 +62,23 @@ <h3>{{ _('Navigation') }}</h3>
7562
{%- block sidebarsourcelink %}
7663
{%- include "sourcelink.html" %}
7764
{%- endblock %}
78-
{%- if customsidebar %}
79-
{%- include customsidebar %}
80-
{%- endif %}
8165
{%- block sidebarsearch %}
8266
{%- include "searchbox.html" %}
8367
{%- endblock %}
8468
{%- endif %}
8569
</div>
70+
{%- block sidebarextra %}{%- endblock %}
8671
</div>
8772
{%- endif %}
8873
{%- endmacro %}
8974

9075
{%- macro script() %}
91-
<script id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
9276
{%- for js in script_files %}
9377
{{ js_tag(js) }}
9478
{%- endfor %}
9579
{%- endmacro %}
9680

9781
{%- macro css() %}
98-
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1)|e }}" type="text/css" />
99-
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
10082
{%- for css in css_files %}
10183
{%- if css|attr("filename") %}
10284
{{ css_tag(css) }}
@@ -109,17 +91,11 @@ <h3>{{ _('Navigation') }}</h3>
10991
{%- if html_tag %}
11092
{{ html_tag }}
11193
{%- else %}
112-
<html{% if not html5_doctype %} xmlns="http://www.w3.org/1999/xhtml"{% endif %}{% if language is not none %} lang="{{ language }}"{% endif %}>
94+
<html{% if language is not none %} lang="{{ language }}"{% endif %} data-content_root="{{ content_root }}">
11395
{%- endif %}
11496
<head>
115-
{%- if not html5_doctype and not skip_ua_compatible %}
116-
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
117-
{%- endif %}
118-
{%- if use_meta_charset or html5_doctype %}
11997
<meta charset="{{ encoding }}" />
120-
{%- else %}
121-
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
122-
{%- endif %}
98+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
12399
{{- metatags }}
124100
{%- block htmltitle %}
125101
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
@@ -139,8 +115,8 @@ <h3>{{ _('Navigation') }}</h3>
139115
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
140116
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
141117
{%- endif %}
142-
{%- if favicon %}
143-
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1)|e }}"/>
118+
{%- if favicon_url %}
119+
<link rel="icon" href="{{ favicon_url|e }}"/>
144120
{%- endif %}
145121
{%- endif %}
146122
{%- block linktags %}
@@ -196,14 +172,30 @@ <h3>{{ _('Navigation') }}</h3>
196172

197173
{%- block relbar2 %}{{ relbar() }}{% endblock %}
198174

175+
{%- macro copyright_block() %}
176+
{%- if hasdoc('copyright') %}
177+
{%- set copyright_prefix = '<a href="' + pathto('copyright') + '">' + _('Copyright') + '</a>' -%}
178+
{%- else %}
179+
{%- set copyright_prefix = _('Copyright') %}
180+
{%- endif %}
181+
{%- if copyright is iterable and copyright is not string %}
182+
{% for copyright_line in copyright %}
183+
{% trans trimmed copyright_prefix=copyright_prefix, copyright=copyright_line|e %}
184+
&#169; {{ copyright_prefix }} {{ copyright }}.
185+
{% endtrans %}
186+
{%- if not loop.last %}<br/>{%- endif %}
187+
{% endfor %}
188+
{%- else %}
189+
{% trans trimmed copyright_prefix=copyright_prefix, copyright=copyright|e %}
190+
&#169; {{ copyright_prefix }} {{ copyright }}.
191+
{% endtrans %}
192+
{%- endif %}
193+
{%- endmacro %}
194+
199195
{%- block footer %}
200196
<div class="footer" role="contentinfo">
201197
{%- if show_copyright %}
202-
{%- if hasdoc('copyright') %}
203-
{% trans path=pathto('copyright'), copyright=copyright|e %}&#169; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
204-
{%- else %}
205-
{% trans copyright=copyright|e %}&#169; Copyright {{ copyright }}.{% endtrans %}
206-
{%- endif %}
198+
{{- copyright_block() -}}
207199
{%- endif %}
208200
{%- if last_updated %}
209201
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
{#
2-
basic/localtoc.html
3-
~~~~~~~~~~~~~~~~~~~
4-
5-
Sphinx sidebar template: local table of contents.
6-
7-
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
8-
:license: BSD, see LICENSE for details.
9-
#}
1+
{# Sphinx sidebar template: local table of contents. #}
102
{%- if display_toc %}
11-
<h3><a href="{{ pathto(master_doc)|e }}">{{ _('Table of Contents') }}</a></h3>
12-
{{ toc }}
3+
<div>
4+
<h3><a href="{{ pathto(root_doc)|e }}">{{ _('Table of Contents') }}</a></h3>
5+
{{ toc }}
6+
</div>
137
{%- endif %}

docs/source/_themes/asc-basic/opensearch.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<Url type="text/html" method="get"
77
template="{{ use_opensearch }}/{{ pathto('search') }}?q={searchTerms}"/>
88
<LongName>{{ docstitle|e }}</LongName>
9-
{%- if favicon %}
10-
<Image height="16" width="16" type="image/x-icon">{{ use_opensearch }}/{{ pathto('_static/' + favicon, 1)|e }}</Image>
9+
{%- if favicon_url %}
10+
<Image height="16" width="16" type="image/x-icon">{{ use_opensearch }}/{{ favicon_url|e }}</Image>
1111
{%- endif %}
1212
{% block extra %} {# Put e.g. an <Image> element here. #} {% endblock %}
1313
</OpenSearchDescription>

0 commit comments

Comments
 (0)