-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add single file and no bullet point option
The single file options means that the file name is formatted when it is set to False (and appending will never happen). When `all_bullets` is set to false, then fragmets that should be rendered as bullet points will have include the bullet itself. In that case, bullets will be sorted to the front (bullets include "*", "-", and "#." enumeration). To make indentation of the ticket info easier, a `get_indent(text)` function is exposed to the jinja template.
- Loading branch information
Showing
6 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
There is now the option for ``all_bullets = false`` in the configuration. | ||
Setting ``all_bullets`` to false means that news fragments have to include | ||
the bullet point if they should be rendered as enumerations, otherwise | ||
they are rendered directly (this means fragments can include a header.). | ||
It is necessary to set this option to avoid (incorrect) automatic indentation | ||
of multiline fragments that do not include bullet points. | ||
The ``template-single-file-no-bullets.rst`` file gives an example template | ||
using these options. |
38 changes: 38 additions & 0 deletions
38
src/towncrier/templates/template-single-file-no-bullets.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% set title = "{} {} Release Notes".format(versiondata.name, versiondata.version) %} | ||
{{ "=" * title|length }} | ||
{{ title }} | ||
{{ "=" * title|length }} | ||
|
||
{% 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 }} | ||
{{ get_indent(text) }}({{values|join(', ') }}) | ||
|
||
{% 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 %} |