Class: WikiDoc
Instance Method Summary
collapse
Methods inherited from BaseDoc
#bare_table, #call_total_function, #close, #end_doc, #flatten_columns, #generate_bare_table, #generate_table, #options_for_functions, #options_for_functions_orig, #print, #start_doc, #table, #table_item, #table_items, #title, #tn
Constructor Details
#initialize(options = {}) ⇒ WikiDoc
Returns a new instance of WikiDoc.
20
21
22
23
|
# File 'lib/libisi/doc/wiki.rb', line 20
def initialize(options = {})
super
@indent = 0
end
|
Instance Method Details
#li(options = {}, &block) ⇒ Object
44
45
46
47
48
|
# File 'lib/libisi/doc/wiki.rb', line 44
def li(options = {}, &block)
writer(options, &block) << (" " * 2*@indent) + "* "
writer(options, &block) << yield
writer(options, &block) << "\n"
end
|
#p(options = {}, &block) ⇒ Object
50
51
52
53
|
# File 'lib/libisi/doc/wiki.rb', line 50
def p(options = {}, &block)
writer(options, &block) << yield
writer(options, &block) << "\n\n"
end
|
#td(options = {}, &block) ⇒ Object
29
30
31
32
33
|
# File 'lib/libisi/doc/wiki.rb', line 29
def td(options = {}, &block)
writer(options, &block) << "|| "
writer(options, &block) << yield
writer(options, &block) << " "
end
|
#th(options = {}, &block) ⇒ Object
34
35
36
37
38
|
# File 'lib/libisi/doc/wiki.rb', line 34
def th(options = {}, &block)
writer(options, &block) << "|| "
writer(options, &block) << yield.to_s.upcase
writer(options, &block) << " "
end
|
#tr(options = {}, &block) ⇒ Object
25
26
27
28
|
# File 'lib/libisi/doc/wiki.rb', line 25
def tr(options = {}, &block)
yield
writer(options, &block) << "||\n"
end
|
#ul(options = {}, &block) ⇒ Object
39
40
41
42
43
|
# File 'lib/libisi/doc/wiki.rb', line 39
def ul(options = {}, &block)
@indent += 1
yield
@indent -= 1
end
|