From 241e5dfbe2216b8f368f5882db2331e947c909ee Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Wed, 6 Dec 2023 02:59:33 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20a=20dedicated=20Towncrier?= =?UTF-8?q?=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES/.TEMPLATE.rst | 36 ++++++++++++++++++++++++++++++++++++ towncrier.toml | 1 + 2 files changed, 37 insertions(+) create mode 100644 CHANGES/.TEMPLATE.rst diff --git a/CHANGES/.TEMPLATE.rst b/CHANGES/.TEMPLATE.rst new file mode 100644 index 00000000..a27a1994 --- /dev/null +++ b/CHANGES/.TEMPLATE.rst @@ -0,0 +1,36 @@ +{# TOWNCRIER TEMPLATE #} +{% for section, _ in sections.items() %} +{% set underline = underlines[0] %}{% if section %}{{section}} +{{ underline * section|length }}{% set underline = underlines[1] %} + +{% endif %} + +{% if sections[section] %} +{% for category, val in definitions.items() if category in sections[section]%} +{{ definitions[category]['name'] }} +{{ underline * definitions[category]['name']|length }} + +{% if definitions[category]['showcontent'] %} +{% for text, values in sections[section][category].items() %} +- {{ text + '\n' }} + {{ values|join(',\n ') + '\n' }} +{% endfor %} + +{% else %} +- {{ sections[section][category]['']|join(', ') }} + +{% endif %} +{% if sections[section][category]|length == 0 %} +No significant changes. + +{% else %} +{% endif %} + +{% endfor %} +{% else %} +No significant changes. + + +{% endif %} +{% endfor %} +---- diff --git a/towncrier.toml b/towncrier.toml index 218cf128..605cc4d8 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -3,6 +3,7 @@ filename = "CHANGES.rst" directory = "CHANGES/" title_format = "{version} ({project_date})" + template = "CHANGES/.TEMPLATE.rst" issue_format = ":issue:`{issue}`" # NOTE: The types are declared because: