From f944d6b1190b4c97ee566e2fe1b4eac64e046944 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Tue, 28 May 2019 23:34:47 +0200 Subject: [PATCH 1/3] Doc: Add an optional obsolete header. --- Doc/README.rst | 15 +++++++++++++++ Doc/tools/templates/layout.html | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/Doc/README.rst b/Doc/README.rst index 31f8a8b7f59328..87ddf905f9bbb6 100644 --- a/Doc/README.rst +++ b/Doc/README.rst @@ -113,6 +113,21 @@ Then, from the ``Doc`` directory, run :: where ```` is one of html, text, latex, or htmlhelp (for explanations see the make targets above). +Deprecation header +================== + +You can define the ``outdated_message`` and ``outdated_link_text`` +variables in ``html_context`` to show a red banner on each page +redirecting to the "latest" version. + +The ``outdated_message`` comes first, the ``outdated_link_text`` comes +afterwards as a link, like this:: + + {{ outdated_message }}{{ outdated_link_text }}. + +The link points to the same page on ``/3/``, sadly for the moment the +language is lost during the process. + Contributing ============ diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index c3992245614082..22835e540a7ddb 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -1,5 +1,14 @@ {% extends "!layout.html" %} +{% block header %} +{%- if outdated_message is defined and outdated_link_text is defined %} +
+ {{ outdated_message }} + {{ outdated_link_text }}. +
+{%- endif %} +{% endblock %} + {% block rootrellink %} {{ super() }}
  • From ab456912592509fc420128e79a8e31e5f874d337 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Wed, 29 May 2019 00:15:20 +0200 Subject: [PATCH 2/3] Make obsolete banner translatable. --- Doc/README.rst | 10 ++-------- Doc/tools/templates/layout.html | 9 ++++++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Doc/README.rst b/Doc/README.rst index 87ddf905f9bbb6..380ea4fa9b26ad 100644 --- a/Doc/README.rst +++ b/Doc/README.rst @@ -116,14 +116,8 @@ see the make targets above). Deprecation header ================== -You can define the ``outdated_message`` and ``outdated_link_text`` -variables in ``html_context`` to show a red banner on each page -redirecting to the "latest" version. - -The ``outdated_message`` comes first, the ``outdated_link_text`` comes -afterwards as a link, like this:: - - {{ outdated_message }}{{ outdated_link_text }}. +You can define the ``outdated`` variable in ``html_context`` to show a +red banner on each page redirecting to the "latest" version. The link points to the same page on ``/3/``, sadly for the moment the language is lost during the process. diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index 22835e540a7ddb..841773f3c7373a 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -1,10 +1,13 @@ {% extends "!layout.html" %} {% block header %} -{%- if outdated_message is defined and outdated_link_text is defined %} +{%- if outdated %}
    - {{ outdated_message }} - {{ outdated_link_text }}. + {% trans %}This document is for an old version of Python that is no longer supported. + You should upgrade, and read the {% endtrans %} + + {% trans %} Python documentation for the last stable release {% endtrans %} + .
    {%- endif %} {% endblock %} From 909f72633256deb3d75138692838ceda0f87e38c Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Wed, 29 May 2019 00:20:05 +0200 Subject: [PATCH 3/3] Avoid a space before the ending dot. --- Doc/tools/templates/layout.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index 841773f3c7373a..a765a5de8a2dfb 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -5,9 +5,7 @@
    {% trans %}This document is for an old version of Python that is no longer supported. You should upgrade, and read the {% endtrans %} - - {% trans %} Python documentation for the last stable release {% endtrans %} - . + {% trans %} Python documentation for the last stable release {% endtrans %}.
    {%- endif %} {% endblock %}