From fbf9d47bd3fc83097269dbf29b7888f777b5036b Mon Sep 17 00:00:00 2001 From: Bill Little Date: Fri, 30 Aug 2024 01:47:37 +0100 Subject: [PATCH] update towncrier changelog template (#1070) --- changelog/1020.dependency.rst | 2 +- changelog/1039.dependency.rst | 3 ++- changelog/1067.dependency.rst | 4 ++-- changelog/1070.documentation.rst | 2 ++ changelog/template.rst | 29 +++++++++++------------------ pyproject.toml | 3 +-- 6 files changed, 19 insertions(+), 24 deletions(-) create mode 100644 changelog/1070.documentation.rst diff --git a/changelog/1020.dependency.rst b/changelog/1020.dependency.rst index 1f5e48ec..b8de887b 100644 --- a/changelog/1020.dependency.rst +++ b/changelog/1020.dependency.rst @@ -1,4 +1,4 @@ Added the `sphinx-changelog `__ package dependency for rendering a ``changelog`` from news fragments using `towncrier `__ and generating a release -``changelong``. (:user:`bjlittle`) +``changelog``. (:user:`bjlittle`) diff --git a/changelog/1039.dependency.rst b/changelog/1039.dependency.rst index ac60123a..2c739ab9 100644 --- a/changelog/1039.dependency.rst +++ b/changelog/1039.dependency.rst @@ -1,2 +1,3 @@ Introduced temporary maximum pin ``towncrier <24.7.0`` due to breaking change -for ``sphinx-changelog``. (:user:`bjlittle`) +for `sphinx-changelog `__. +(:user:`bjlittle`) diff --git a/changelog/1067.dependency.rst b/changelog/1067.dependency.rst index 0e25459d..b7a42d96 100644 --- a/changelog/1067.dependency.rst +++ b/changelog/1067.dependency.rst @@ -1,2 +1,2 @@ -Unpinned ``towncrier`` and introduced minimum pin ``sphinx-changelog>=1.6.0``. -(:user:`bjlittle`) +Unpinned `towncrier `__ and introduced +minimum pin ``sphinx-changelog >=1.6.0``. (:user:`bjlittle`) diff --git a/changelog/1070.documentation.rst b/changelog/1070.documentation.rst new file mode 100644 index 00000000..47688f34 --- /dev/null +++ b/changelog/1070.documentation.rst @@ -0,0 +1,2 @@ +Updated the `towncrier `__ ``changelog`` +template. (:user:`bjlittle`) diff --git a/changelog/template.rst b/changelog/template.rst index 947cf0d7..8fe849fa 100644 --- a/changelog/template.rst +++ b/changelog/template.rst @@ -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 %} diff --git a/pyproject.toml b/pyproject.toml index f068249f..d2522dc3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -295,7 +295,6 @@ package = "geovista" package_dir = "src" filename = "CHANGELOG.rst" directory = "changelog" -title_format = "v{version} ({project_date})" template = "changelog/template.rst" # @@ -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