method
display_list

v1_9_1_378 -
Show latest stable
-
0 notes -
Class: HtmlFormatter
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
display_list(list)
public
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(/ /, ' ')}</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