|
|
@ -0,0 +1,19 @@ |
|
|
|
# {% assign changelog = changelog | replace_regexp:'* fixed','<span class="fixed">fixed</span>' %} |
|
|
|
# {% assign changelog = changelog | replace_regexp:'^added','<span class="added">added</span>' %} |
|
|
|
# {% assign changelog = changelog | replace_regexp:'^removed','<span class="removed">removed</span>' %} |
|
|
|
# {% assign changelog = changelog | replace_regexp:'^rewrote','<span class="rewrote">rewrote</span>' %} |
|
|
|
module Jekyll |
|
|
|
module PrettyChangelog |
|
|
|
def pretty_changelog(input) |
|
|
|
lines = input.split(/\n/) |
|
|
|
lines = lines.map { |line| line.sub(/\* fixed/i, "* <span class=\"fixed\">fixed</span>") } |
|
|
|
lines = lines.map { |line| line.sub(/\* added/i, "* <span class=\"added\">added</span>") } |
|
|
|
lines = lines.map { |line| line.sub(/\* removed/i, "* <span class=\"removed\">removed</span>") } |
|
|
|
lines = lines.map { |line| line.sub(/\* rewrote/i, "* <span class=\"rewrote\">rewrote</span>") } |
|
|
|
# input.gsub(re, repl_str) if !input.nil? |
|
|
|
input = lines.join("\n") |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
Liquid::Template.register_filter(Jekyll::PrettyChangelog) |