Flowdock
method

display_list

Importance_0
v1_9_1_378 - Show latest stable - 0 notes - Class: HtmlFormatter
display_list(list) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rdoc/ri/formatter.rb, line 484
  def display_list(list)
    case list.type
    when :BULLET then
      list_type = "ul"
      prefixer = proc { |ignored| "<li>" }

    when :NUMBER, :UPPERALPHA, :LOWERALPHA then
      list_type = "ol"
      prefixer = proc { |ignored| "<li>" }

    when :LABELED then
      list_type = "dl"
      prefixer = proc do |li|
        "<dt><b>" + escape(li.label) + "</b><dd>"
      end

    when :NOTE then
      list_type = "table"
      prefixer = proc do |li|
        %{<tr valign="top"><td>#{li.label.gsub(/ /, '&nbsp;')}</td><td>}
      end
    else
      fail "unknown list type"
    end

    @output.print "<#{list_type}>"
    list.contents.each do |item|
      if item.kind_of? RDoc::Markup::Flow::LI
        prefix = prefixer.call(item)
        @output.print prefix
        display_flow_item(item, prefix)
      else
        display_flow_item(item)
      end
    end
    @output.print "</#{list_type}>"
  end
Register or log in to add new notes.