Skip to content

Commit

Permalink
update towncrier changelog template (#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle authored Aug 30, 2024
1 parent f8ed96a commit fbf9d47
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 24 deletions.
2 changes: 1 addition & 1 deletion changelog/1020.dependency.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Added the `sphinx-changelog <https://github.com/OpenAstronomy/sphinx-changelog>`__
package dependency for rendering a ``changelog`` from news fragments using
`towncrier <https://github.com/twisted/towncrier>`__ and generating a release
``changelong``. (:user:`bjlittle`)
``changelog``. (:user:`bjlittle`)
3 changes: 2 additions & 1 deletion changelog/1039.dependency.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Introduced temporary maximum pin ``towncrier <24.7.0`` due to breaking change
for ``sphinx-changelog``. (:user:`bjlittle`)
for `sphinx-changelog <https://github.com/OpenAstronomy/sphinx-changelog>`__.
(:user:`bjlittle`)
4 changes: 2 additions & 2 deletions changelog/1067.dependency.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Unpinned ``towncrier`` and introduced minimum pin ``sphinx-changelog>=1.6.0``.
(:user:`bjlittle`)
Unpinned `towncrier <https://github.com/twisted/towncrier>`__ and introduced
minimum pin ``sphinx-changelog >=1.6.0``. (:user:`bjlittle`)
2 changes: 2 additions & 0 deletions changelog/1070.documentation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Updated the `towncrier <https://github.com/twisted/towncrier>`__ ``changelog``
template. (:user:`bjlittle`)
29 changes: 11 additions & 18 deletions changelog/template.rst
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
{% for section in sections %}
{% set underline = underlines[0] %}
{% if section %}
{{ section }}
{{ underline * section|length }}{% set underline = underlines[1] %}
.. _gv-changelog-{{ versiondata.date }}:

{% if render_title %}
v{{ versiondata.version }} ({{ versiondata.date }})
{{ top_underline * ((versiondata.version + versiondata.date)|length + 4)}}
{% endif %}
{% if sections[section] %}
{% for category in definitions if category in sections[section] %}
{% for section, _ in sections.items() %}
{% set underline = underlines[0] %}

{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section]%}
{{ definitions[category]['name'] }}
{{ underline * (definitions[category]['name']|length + 1) }}

{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category]|dictsort(by='value') %}
{% if not values or values[0][0] == '+' %}
- {{ text }}
{% else %}
{% set comma = joiner(', ') %}
- {% for value in values|sort %}{{ comma() }}:fa:`code-pull-request` :pull:`{{ value[1:] }}`{% endfor %}: {{ text|replace(":issue:", ":far:`circle-dot` :issue:") }}
{% endif %}
{% endfor %}

{% else %}
- {{ sections[section][category]['']|join(', ') }}
{% endfor %}

{% endif %}
{% if sections[section][category]|length == 0 %}

No significant changes.

{% else %}
{% endif %}

{% endfor %}
{% else %}

No significant changes.


{% endif %}
{% endfor %}
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ package = "geovista"
package_dir = "src"
filename = "CHANGELOG.rst"
directory = "changelog"
title_format = "v{version} ({project_date})"
template = "changelog/template.rst"

#
Expand Down Expand Up @@ -344,7 +343,7 @@ name = "📚 Documentation"
showcontent = true

[[tool.towncrier.type]]
# Miscellaneos internal and maintenance changes.
# Miscellaneous internal and maintenance changes.
directory = "internal"
name = "💼 Internal"
showcontent = true
Expand Down

0 comments on commit fbf9d47

Please sign in to comment.