Add `hangar` format to release note script.

Hangar uses Markdown, so this is a very easy release note "conversion"
just like GitHub Releases.
This commit is contained in:
Andreas Troelsen 2023-12-31 15:14:25 +01:00
parent 8e5d2f0d23
commit b881943656
1 changed files with 12 additions and 1 deletions

View File

@ -26,7 +26,7 @@ def parse_args():
parser.add_argument(
'--format',
'-f',
choices=['github', 'spigot', 'curse'],
choices=['github', 'hangar', 'spigot', 'curse'],
help='the format to output the release notes in',
)
@ -80,6 +80,8 @@ def extract(target):
def output(lines, fmt):
if fmt == 'github':
output_as_github_markdown(lines)
elif fmt == 'hangar':
output_as_hangar_markdown(lines)
elif fmt == 'spigot':
output_as_spigot_bbcode(lines)
elif fmt == 'curse':
@ -97,6 +99,15 @@ def output_as_github_markdown(lines):
output_raw(lines[1:])
def output_as_hangar_markdown(lines):
"""
Hangar Versions use Markdown in the same format as GitHub Releases, so we
don't actually need to do anything else here either. Just strip the first
line so we don't get a duplicate header.
"""
output_raw(lines[1:])
def output_as_spigot_bbcode(lines):
"""
Spigot uses BBCode for resource update descriptions. It's very similar to