Extracts sections of text enclosed in plus, tt or code. Used to discover undocumented parameters.

Methods
A
D
E
N
S
T
Attributes
[R] list_type

Stack of list types

[R] res

Output accumulator

Class Public methods
new(markup = nil)

Creates a new tt-only formatter.

# File ../ruby/lib/rdoc/markup/to_tt_only.rb, line 23
def initialize markup = nil
  super

  add_tag :TT, nil, nil
end
Instance Public methods
accept_blank_line(markup_item)
Alias for: do_nothing
accept_heading(markup_item)
Alias for: do_nothing
accept_list_end(list)

Pops the list type for list from list_type

# File ../ruby/lib/rdoc/markup/to_tt_only.rb, line 32
def accept_list_end list
  @list_type.pop
end
accept_list_item_end(markup_item)
Alias for: do_nothing
accept_list_item_start(list_item)

Prepares the visitor for consuming list_item

# File ../ruby/lib/rdoc/markup/to_tt_only.rb, line 46
def accept_list_item_start list_item
  case @list_type.last
  when :NOTE, :LABEL then
    tt_sections(list_item.label)
  end
end
accept_list_start(list)

Pushes the list type for list onto list_type

# File ../ruby/lib/rdoc/markup/to_tt_only.rb, line 39
def accept_list_start list
  @list_type << list.type
end
accept_paragraph(paragraph)

Adds paragraph to the output

# File ../ruby/lib/rdoc/markup/to_tt_only.rb, line 56
def accept_paragraph paragraph
  tt_sections(paragraph.text)
end
accept_raw(markup_item)
Alias for: do_nothing
accept_rule(markup_item)
Alias for: do_nothing
accept_verbatim(markup_item)
Alias for: do_nothing
do_nothing(markup_item)

Does nothing to markup_item because it doesn't have any user-built content

# File ../ruby/lib/rdoc/markup/to_tt_only.rb, line 64
def do_nothing markup_item
end
end_accepting()

Returns an Array of items that were wrapped in plus, tt or code.

# File ../ruby/lib/rdoc/markup/to_tt_only.rb, line 100
def end_accepting
  @res.compact
end
start_accepting()

Prepares the visitor for gathering tt sections

# File ../ruby/lib/rdoc/markup/to_tt_only.rb, line 107
def start_accepting
  @res = []

  @list_type = []
end
tt_sections(text)

Extracts tt sections from text

# File ../ruby/lib/rdoc/markup/to_tt_only.rb, line 77
def tt_sections text
  flow = @am.flow text.dup

  flow.each do |item|
    case item
    when String then
      @res << item if in_tt?
    when RDoc::Markup::AttrChanger then
      off_tags res, item
      on_tags res, item
    when RDoc::Markup::Special then
      @res << convert_special(item) if in_tt? # TODO can this happen?
    else
      raise "Unknown flow element: #{item.inspect}"
    end
  end

  res
end