diff options
Diffstat (limited to 'bin/ImANerdRules.rb')
-rwxr-xr-x | bin/ImANerdRules.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/ImANerdRules.rb b/bin/ImANerdRules.rb index 2443f51..5d74d04 100755 --- a/bin/ImANerdRules.rb +++ b/bin/ImANerdRules.rb @@ -6,10 +6,13 @@ require 'redcarpet' module ImANerdRules class CustomRender < Redcarpet::Render::HTML - def header(text, header_level) - text =~ /([\d+\.?]+)/ - "<h#{header_level} id=\"hdr#{$1}\">#{text}</h#{header_level}>" - end + def header(text, header_level) + text =~ /([\d+\.?]+)/ + "<h#{header_level} id=\"hdr#{$1}\">#{text}</h#{header_level}>" + end + def image link, title, alt_text + "<a data-fancybox='gallery' data-caption='#{title}' href='#{link}'><img src='#{link.gsub(/.png/,'_th.png')}'></a>" + end end class Node |