Skip to content

Commit 8486716

Browse files
JulienPalardlarryhastings
authored andcommitted
[3.5] Doc: Add an optional obsolete header. (GH-13638). (#13658)
* [3.5] Doc: Add an optional obsolete header. (GH-13638). (cherry picked from commit 46ed90d) Co-authored-by: Julien Palard <[email protected]>
1 parent 2bb3278 commit 8486716

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Doc/README.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ Then, from the ``Doc`` directory, run ::
104104
where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations
105105
see the make targets above).
106106

107+
Deprecation header
108+
==================
109+
110+
You can define the ``outdated`` variable in ``html_context`` to show a
111+
red banner on each page redirecting to the "latest" version.
112+
113+
The link points to the same page on ``/3/``, sadly for the moment the
114+
language is lost during the process.
115+
107116

108117
Contributing
109118
============

Doc/tools/templates/layout.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
{% extends "!layout.html" %}
2+
3+
{% block header %}
4+
{%- if outdated %}
5+
<div id="outdated-warning" style="padding: .5em; text-align: center; background-color: #FFBABA; color: #6A0E0E;">
6+
{% trans %}This document is for an old version of Python that is no longer supported.
7+
You should upgrade, and read the {% endtrans %}
8+
<a href="/3/{{ pagename }}{{ file_suffix }}">{% trans %} Python documentation for the current stable release{% endtrans %}</a>.
9+
</div>
10+
{%- endif %}
11+
{% endblock %}
12+
213
{% block rootrellink %}
314
<li><img src="{{ pathto('_static/py.png', 1) }}" alt=""
415
style="vertical-align: middle; margin-top: -1px"/></li>

0 commit comments

Comments
 (0)