Skip to content

Commit

Permalink
📝 Add a dedicated Towncrier template
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Dec 6, 2023
1 parent f384fef commit 241e5df
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions CHANGES/.TEMPLATE.rst
Original file line number Diff line number Diff line change
@@ -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 %}
----
1 change: 1 addition & 0 deletions towncrier.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 241e5df

Please sign in to comment.