frozen_string_literal: true
Extracts just the RDoc::Markup::Heading elements from a RDoc::Markup::Document to help build a table of contents
Adds document to the output, using its heading cutoff if
present
# File rdoc/markup/to_table_of_contents.rb, line 36
def accept_document document
@omit_headings_below = document.omit_headings_below
super
end
Adds heading to the table of contents
# File rdoc/markup/to_table_of_contents.rb, line 45
def accept_heading heading
@res << heading unless suppressed? heading
end
Returns the table of contents
# File rdoc/markup/to_table_of_contents.rb, line 52
def end_accepting
@res
end