From df84d1ce6297818cb069378a15eab4946b06b880 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 15 Apr 2021 01:31:51 +0800 Subject: [PATCH 1/2] Upgrade sphinxcontrib-towncrier for docs --- tools/requirements/docs.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/requirements/docs.txt b/tools/requirements/docs.txt index 199edcfd6b3..1ab19c9b9ab 100644 --- a/tools/requirements/docs.txt +++ b/tools/requirements/docs.txt @@ -1,11 +1,10 @@ sphinx == 3.2.1 -# FIXME: Remove towncrier constraint after upgrading sphinxcontrib-towncrier. -towncrier < 19.9.0 +towncrier furo myst_parser sphinx-copybutton sphinx-inline-tabs -sphinxcontrib-towncrier +sphinxcontrib-towncrier >= 0.2.0a0 # `docs.pipext` uses pip's internals to generate documentation. So, we install # the current directory to make it work. From a79c6267de60410de4aa37fa65637d4a4d0ff45e Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 15 Apr 2021 07:21:24 +0800 Subject: [PATCH 2/2] Render top_line explicitly in towncrier template This allows sphinxcontrib-towncrier to render it in the documentation. The rendering of NEWS.rst is unchanged since Towncrier detects automatically if that line exists and does not render a duplicated section title. --- tools/news/template.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/news/template.rst b/tools/news/template.rst index 7ea90573dc2..70d6ab75def 100644 --- a/tools/news/template.rst +++ b/tools/news/template.rst @@ -1,7 +1,9 @@ -{% for section in sections %} +{{ top_line -}} + +{%- for section in sections %} {% set underline = "-" %} {% if section %} -{{section}} +{{ section }} {{ underline * section|length }}{% set underline = "~" %} {% endif %}