| Class | RI::OverstrikeFormatter |
| In: |
ri/ri_formatter.rb
|
| Parent: | AttributeFormatter |
This formatter generates overstrike-style formatting, which works with pagers such as man and less.
| BS | = | "\C-h" |
draw a string in bold
# File ri/ri_formatter.rb, line 390
390: def bold_print(text)
391: text.split(//).each do |ch|
392: print ch, BS, ch
393: end
394: end
# File ri/ri_formatter.rb, line 374
374: def write_attribute_text(prefix, line)
375: print prefix
376: line.each do |achar|
377: attr = achar.attr
378: if (attr & (ITALIC+CODE)) != 0
379: print "_", BS
380: end
381: if (attr & BOLD) != 0
382: print achar.char, BS
383: end
384: print achar.char
385: end
386: puts
387: end