From b8819436566b1d063471836de3aad4194f04d96e Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Sun, 31 Dec 2023 15:14:25 +0100 Subject: [PATCH] Add `hangar` format to release note script. Hangar uses Markdown, so this is a very easy release note "conversion" just like GitHub Releases. --- scripts/extract-release-notes | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/extract-release-notes b/scripts/extract-release-notes index 8b75743..4230338 100755 --- a/scripts/extract-release-notes +++ b/scripts/extract-release-notes @@ -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