Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摑 Enable showing news categories in towncrier log #2399

Merged
merged 2 commits into from Oct 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/2394.doc.rst
@@ -0,0 +1,3 @@
Extended towncrier news template to include change note categories.
This allows to see what types of changes a given version introduces
-- by :user:`webknjaz`
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -15,7 +15,7 @@ backend-path = ["."]
title_format = "v{version}"
issue_format = "#{issue}"
template = "towncrier_template.rst"
underlines = ["-"]
underlines = ["-", "^"]

[[tool.towncrier.type]]
directory = "deprecation"
Expand Down
4 changes: 4 additions & 0 deletions towncrier_template.rst
@@ -1,10 +1,14 @@
{% 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() %}
* {{ values|join(', ') }}: {{ text }}
Expand Down