Created
April 25, 2019 16:12
-
-
Save stephen-bunn/9be6f7360d92d8f037a103f61280d1e2 to your computer and use it in GitHub Desktop.
Medium - Towncrier CHANGELOG jinja2 template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for section in sections %} | |
{% set underline = "-" %} | |
{% if section %} | |
{{ section }} | |
{{ underline * section|length }}{% set underline = "~" %} | |
{% endif %} | |
{% if sections[section] %} | |
{% for category, value in definitions.items() if category in sections[section] and category != 'trivial' %} | |
{{ definitions[category]['name'] }} | |
{{ underline * definitions[category]['name']|length }} | |
{% if definitions[category]['showcontent'] %} | |
{% for text, values in sections[section][category]|dictsort(by='value') %} | |
- {{ text }} {% if category not in ['process', 'misc', 'doc'] %}{{ values|sort|join(',\n ') }}{% endif %} | |
{% endfor %} | |
{% else %} | |
- {{ sections[section][category]['']|sort|join(', ') }} | |
{% endif %} | |
{% if sections[section][category]|length == 0 %} | |
No significant changes. | |
{% else %} | |
{% endif %} | |
{% endfor %} | |
{% else %} | |
No significant changes. | |
{% endif %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment