diff --git a/doc/changelog.d/610.added.md b/doc/changelog.d/610.added.md new file mode 100644 index 00000000..459ae457 --- /dev/null +++ b/doc/changelog.d/610.added.md @@ -0,0 +1 @@ +feat: Create jinja template for changelog actions \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d0798051..f4609a8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,14 +125,16 @@ show_missing = true [tool.towncrier] directory = "doc/changelog.d" filename = "doc/source/changelog.rst" -template = "doc/changelog.d/changelog_template.jinja" +template = "ansys_sphinx_theme:changelog_template.jinja" start_string = ".. towncrier release notes start\n" title_format = "`{version} `_ ({project_date})" issue_format = "`#{issue} `_" +all_bullets = false +underlines = ["=", "^"] [[tool.towncrier.type]] directory = "added" -name = "Added" +name = "Features" showcontent = true [[tool.towncrier.type]] @@ -142,7 +144,7 @@ showcontent = true [[tool.towncrier.type]] directory = "fixed" -name = "Fixed" +name = "Bug fixes" showcontent = true [[tool.towncrier.type]] diff --git a/src/ansys_sphinx_theme/templates/__init__.py b/src/ansys_sphinx_theme/templates/__init__.py new file mode 100644 index 00000000..a92737f9 --- /dev/null +++ b/src/ansys_sphinx_theme/templates/__init__.py @@ -0,0 +1,23 @@ +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +"""Reusable templates for changelog files.""" diff --git a/src/ansys_sphinx_theme/templates/changelog_template.jinja b/src/ansys_sphinx_theme/templates/changelog_template.jinja new file mode 100644 index 00000000..01d8324e --- /dev/null +++ b/src/ansys_sphinx_theme/templates/changelog_template.jinja @@ -0,0 +1,19 @@ +{% if sections[""] %} + +.. tab-set:: + {%+ for category, val in definitions.items() if category in sections[""] +%} + .. tab-item:: {{ definitions[category]['name'] }} + + .. list-table:: + :header-rows: 0 + :widths: auto + + {%+ for text, values in sections[""][category].items() +%} + * - {{ text }} + - {{ values|join(', ') }} + {% endfor %} + {% endfor %} + +{% else %} +No significant changes. +{% endif %} \ No newline at end of file