class TDiary::Style::BlogwikiDiary
Public Instance Methods
append( body, author = nil )
click to toggle source
# File lib/tdiary/style/blogwiki.rb, line 30 def append( body, author = nil ) section = nil body.each_line do |l| case l when /^\![^!]/ @sections << BlogwikiSection::new( section, author ) if section section = l else section = '' unless section section << l end end @sections << BlogwikiSection::new( section, author ) if section @last_modified = Time::now self end
style()
click to toggle source
# File lib/tdiary/style/blogwiki.rb, line 26 def style 'BlogWiki' end
to_chtml( opt )
click to toggle source
# File lib/tdiary/style/blogwiki.rb, line 61 def to_chtml( opt ) r = '' idx = 1 each_section do |section| r << section.chtml( date, idx, opt ) idx += 1 end r end
to_html4( opt )
click to toggle source
# File lib/tdiary/style/blogwiki.rb, line 47 def to_html4( opt ) r = '' idx = 1 each_section do |section| if idx > 1 and not opt['anchor'] then r << %Q|<p class="readmore"><a href="#{opt['index']}<%=anchor "#{date.strftime( '%Y%m%d' )}"%>">Read more...</a></p>\n| break end r << section.html4( date, idx, opt ) idx += 1 end r end