Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitee2549c

Browse files
authored
bpo-41028: Doc: Move switchers to docsbuild-scripts. (GH-20969)
1 parent825ac38 commitee2549c

File tree

6 files changed

+16
-173
lines changed

6 files changed

+16
-173
lines changed

‎Doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ serve:
215215

216216
# for development releases: always build
217217
autobuild-dev:
218-
make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A switchers=1'
218+
make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
219219
-make suspicious
220220

221221
# for quick rebuilds (HTML only)
222222
autobuild-dev-html:
223-
make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A switchers=1'
223+
make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
224224

225225
# for stable releases: only build if not in pre-release stage (alpha, beta)
226226
# release candidate downloads are okay, since the stable tree can be in that stage

‎Doc/tools/static/switchers.js

Lines changed: 0 additions & 156 deletions
This file was deleted.

‎Doc/tools/templates/dummy.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@
66
{% trans %}CPython implementation detail:{% endtrans %}
77
{% trans %}Deprecated since version {deprecated}, will be removed in version {removed}{% endtrans %}
88
{% trans %}Deprecated since version {deprecated}, removed in version {removed}{% endtrans %}
9+
10+
11+
In docsbuild-scripts, when rewriting indexsidebar.html with actual versions:
12+
13+
{% trans %}in development{% endtrans %}
14+
{% trans %}pre-release{% endtrans %}
15+
{% trans %}stable{% endtrans %}
16+
{% trans %}security-fixes{% endtrans %}
17+
{% trans %}EOL{% endtrans %}

‎Doc/tools/templates/indexsidebar.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ <h3>{% trans %}Download{% endtrans %}</h3>
22
<p><ahref="{{ pathto('download') }}">{% trans %}Download these documents{% endtrans %}</a></p>
33
<h3>{% trans %}Docs by version{% endtrans %}</h3>
44
<ul>
5-
<li><ahref="https://docs.python.org/3.10/">{% trans %}Python 3.10 (in development){% endtrans %}</a></li>
6-
<li><ahref="https://docs.python.org/3.9/">{% trans %}Python 3.9 (pre-release){% endtrans %}</a></li>
7-
<li><ahref="https://docs.python.org/3.8/">{% trans %}Python 3.8 (stable){% endtrans %}</a></li>
8-
<li><ahref="https://docs.python.org/3.7/">{% trans %}Python 3.7 (stable){% endtrans %}</a></li>
9-
<li><ahref="https://docs.python.org/3.6/">{% trans %}Python 3.6 (security-fixes){% endtrans %}</a></li>
10-
<li><ahref="https://docs.python.org/2.7/">{% trans %}Python 2.7 (EOL){% endtrans %}</a></li>
5+
<li><ahref="https://docs.python.org/">{% trans %}Stable{% endtrans %}</a></li>
6+
<li><ahref="https://docs.python.org/dev/">{% trans %}In development{% endtrans %}</a></li>
117
<li><ahref="https://www.python.org/doc/versions/">{% trans %}All versions{% endtrans %}</a></li>
128
</ul>
139

‎Doc/tools/templates/layout.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,14 @@
1212

1313
{% block rootrellink %}
1414
{{ super() }}
15-
<li>
16-
{%- if switchers is defined %}
17-
<spanclass="language_switcher_placeholder">{{ language or 'en' }}</span>
18-
<spanclass="version_switcher_placeholder">{{ release }}</span>
19-
<ahref="{{ pathto('index') }}">{% trans %}Documentation {% endtrans %}</a>{{ reldelim1 }}
20-
{%- else %}
15+
<liid="cpython-language-and-version">
2116
<ahref="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
22-
{%- endif %}
2317
</li>
2418
{% endblock %}
2519

2620
{% block extrahead %}
2721
<linkrel="canonical"href="https://docs.python.org/3/{{pagename}}.html"/>
2822
{% if builder != "htmlhelp" %}
29-
{% if switchers is defined and not embedded %}
30-
<scripttype="text/javascript"src="{{ pathto('_static/switchers.js', 1) }}"></script>{% endif %}
3123
{% if pagename == 'whatsnew/changelog' and not embedded %}
3224
<scripttype="text/javascript"src="{{ pathto('_static/changelog_search.js', 1) }}"></script>{% endif %}
3325
{% endif %}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Language and version switchers, previously maintained in every cpython
2+
branches, are now handled by docsbuild-script.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp