Merge pull request #322 from retorquere/front-matter

Introduce frontmatter option: YAML front matter for GitHub Pages
This commit is contained in:
Olle Jonsson 2016-02-03 14:25:39 +01:00
commit dd3a618d23
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