Skip to content

Commit

Permalink
contributing: Add empty line after heading in release notes (#3048)
Browse files Browse the repository at this point in the history
Based on the issue reported on Gitter 'there must be an empty line after the section titles to be valid MD.' This adds an extra newline after the headings generated by the script. Some headings are generated by the GitHub API and they don't include the line. GitHub rendering works well for both versions.
  • Loading branch information
wenzeslaus authored and neteler committed Jun 20, 2023
1 parent c335424 commit b565a74
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions utils/generate_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ def split_to_categories(changes, categories):
return by_category


def print_section_heading_2(text, file=None):
print(f"### {text}\n", file=file)


def print_section_heading_3(text, file=None):
print(f"### {text}\n", file=file)


def print_category(category, changes, file=None):
"""Print changes for one category from dictionary of changes
Expand All @@ -72,7 +80,7 @@ def print_category(category, changes, file=None):
items = changes.get(category, None)
if not items:
return
print(f"### {category}", file=file)
print_section_heading_3(category, file=file)
for item in sorted(items):
print(f"* {item}", file=file)
print("")
Expand Down Expand Up @@ -109,7 +117,7 @@ def print_notes(

if before:
print(before)
print("## What's Changed", file=file)
print_section_heading_2("What's Changed", file=file)
changes_by_category = split_to_categories(changes, categories=categories)
print_by_category(changes_by_category, categories=categories, file=file)
if after:
Expand Down

0 comments on commit b565a74

Please sign in to comment.