Outputs RDoc markup with hot backspace action! You will probably need a pager to use this output format.
This formatter won’t work on 1.8.6 because it lacks String#chars.
# File lib/rdoc/markup/to_bs.rb, line 27
27: def accept_heading heading
28: use_prefix or @res << ' ' * @indent
29: @res << @headings[heading.level][0]
30: @in_b = true
31: @res << attributes(heading.text)
32: @in_b = false
33: @res << @headings[heading.level][1]
34: @res << "\n"
35: end
Turns on or off special handling for convert_string
# File lib/rdoc/markup/to_bs.rb, line 40
40: def annotate tag
41: case tag
42: when '+b' then @in_b = true
43: when '-b' then @in_b = false
44: when '+_' then @in_em = true
45: when '-_' then @in_em = false
46: end
47:
48: ''
49: end
Calls convert_string on the result of convert_special
# File lib/rdoc/markup/to_bs.rb, line 54
54: def convert_special special
55: convert_string super
56: end
Adds bold or underline mixed with backspaces
# File lib/rdoc/markup/to_bs.rb, line 61
61: def convert_string string
62: return string unless string.respond_to? :chars # your ruby is lame
63: return string unless @in_b or @in_em
64: chars = if @in_b then
65: string.chars.map do |char| "#{char}\b#{char}" end
66: elsif @in_em then
67: string.chars.map do |char| "_\b#{char}" end
68: end
69:
70: chars.join
71: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.