Skip to content

Commit

Permalink
Merge pull request #2399 from webknjaz/maintenance/towncrier-categories
Browse files Browse the repository at this point in the history
馃摑 Enable showing news categories in towncrier log
  • Loading branch information
jaraco committed Oct 17, 2020
2 parents 0ce0715 + a278b0f commit 893d815
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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

0 comments on commit 893d815

Please sign in to comment.