Class: TDiary::Style::BlogwikiDiary

Inherits:
WikiDiary
  • Object
show all
Defined in:
lib/tdiary/style/blogwiki.rb

Instance Method Summary collapse

Instance Method Details

#append(body, author = nil) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/tdiary/style/blogwiki.rb', line 31

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

#styleObject



27
28
29
# File 'lib/tdiary/style/blogwiki.rb', line 27

def style
	'BlogWiki'
end

#to_chtml(opt) ⇒ Object



62
63
64
65
66
67
68
69
70
# File 'lib/tdiary/style/blogwiki.rb', line 62

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) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/tdiary/style/blogwiki.rb', line 48

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