Method: RDoc::Markup::ToHtml#accept_heading

Defined in:
lib/rdoc/markup/to_html.rb

#accept_heading(heading) ⇒ Object

Adds heading to the output. The headings greater than 6 are trimmed to level 6.



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/rdoc/markup/to_html.rb', line 292

def accept_heading heading
  level = [6, heading.level].min

  label = heading.label @code_object

  @res << if @options.output_decoration
            "\n<h#{level} id=\"#{label}\">"
          else
            "\n<h#{level}>"
          end
  @res << to_html(heading.text)
  unless @options.pipe then
    @res << "<span><a href=\"##{label}\">&para;</a>"
    @res << " <a href=\"#top\">&uarr;</a></span>"
  end
  @res << "</h#{level}>\n"
end