49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/tdiary/style/blogrd.rb', line 49
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
|