class TDiary::Style::BlogrdDiary

Public Instance Methods

style() click to toggle source
# File lib/tdiary/style/blogrd.rb, line 44
def style
        'BlogRD'
end
to_html( opt, mode=:HTML ) click to toggle source
# File lib/tdiary/style/blogrd.rb, line 48
def to_html( opt, mode=:HTML )
        v = RD2BlogVisitor.new( date, 0, opt, @author )
        r = ''
        @sections.each_with_index do | section, i |
                if i == 0 or opt['anchor'] then
                        t = RDTree.new( ("=begin\n%s\n=end" % section.to_src).to_a, nil, nil )
                        t.parse
                        r << %Q[<div class="section">%s</div>] % v.visit( t )
                else
                        r << %Q[<p class="readmore"><a href="%s<%%=anchor "%s"%%>">Read more ...</a></p>\n] % [opt['index'], date.strftime('%Y%m%d')]
                        break;
                end
        end
        r
end