Class: RDoc::RI::SimpleFormatter

Inherits:
Formatter show all
Defined in:
lib/rdoc/ri/formatter.rb

Overview

This formatter reduces extra lines for a simpler output. It improves way output looks for tools like IRC bots.

Constant Summary

Constants inherited from Formatter

Formatter::FORMATTERS

Instance Attribute Summary

Attributes inherited from Formatter

#indent, #output

Instance Method Summary collapse

Methods inherited from Formatter

#bold_print, #break_to_newline, #conv_html, #conv_markup, #display_flow, #display_flow_item, #display_list, #display_verbatim_flow_item, for, #initialize, list, #raw_print_line, #strip_attributes, #wrap

Constructor Details

This class inherits a constructor from RDoc::RI::Formatter

Instance Method Details

#blanklineObject

No extra blank lines



582
583
# File 'lib/rdoc/ri/formatter.rb', line 582

def blankline
end

#display_heading(text, level, indent) ⇒ Object

Place heading level indicators inline with heading.



598
599
600
601
602
603
604
605
606
607
608
# File 'lib/rdoc/ri/formatter.rb', line 598

def display_heading(text, level, indent)
  text = strip_attributes(text)
  case level
  when 1
    @output.puts "= " + text.upcase
  when 2
    @output.puts "-- " + text
  else
    @output.print indent, text, "\n"
  end
end

#draw_line(label = nil) ⇒ Object

Display labels only, no lines



588
589
590
591
592
593
# File 'lib/rdoc/ri/formatter.rb', line 588

def draw_line(label=nil)
  unless label.nil? then
    bold_print(label)
    @output.puts
  end
end