YAML front matter

This commit is contained in:
retorquere 2016-02-03 13:56:44 +01:00
parent 4f932fda1a
commit a282e6c53e
2 changed files with 6 additions and 1 deletions

View File

@ -8,7 +8,9 @@ module GitHubChangelogGenerator
sort_tags_by_date(@filtered_tags)
fetch_issues_and_pr
log = "#{@options[:header]}\n\n"
log = ''
log += @options[:frontmatter] if @options[:frontmatter]
log += "#{@options[:header]}\n\n"
if @options[:unreleased_only]
log += generate_log_between_tags(filtered_tags[0], nil)

View File

@ -68,6 +68,9 @@ module GitHubChangelogGenerator
opts.on("--header-label [LABEL]", "Setup custom header label. Default is \"# Change Log\"") do |v|
options[:header] = v
end
opts.on("--front-matter [JSON]", "Add YAML front matter. Formatted as JSON because it's easier to add on the command line") do |v|
options[:frontmatter] = JSON.parse(v).to_yaml + "---\n"
end
opts.on("--pr-label [LABEL]", "Setup custom label for pull requests section. Default is \"**Merged pull requests:**\"") do |v|
options[:merge_prefix] = v
end