Skip to content

Commit 46ed90d

Browse files
authored
Doc: Add an optional obsolete header. (GH-13638)
1 parent 1c99926 commit 46ed90d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Doc/README.rst

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

116+
Deprecation header
117+
==================
118+
119+
You can define the ``outdated`` variable in ``html_context`` to show a
120+
red banner on each page redirecting to the "latest" version.
121+
122+
The link points to the same page on ``/3/``, sadly for the moment the
123+
language is lost during the process.
124+
116125

117126
Contributing
118127
============

Doc/tools/templates/layout.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
{% extends "!layout.html" %}
22

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 last stable release {% endtrans %}</a>.
9+
</div>
10+
{%- endif %}
11+
{% endblock %}
12+
313
{% block rootrellink %}
414
{{ super() }}
515
<li>

0 commit comments

Comments
 (0)