mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc/markup: Remove ListBase and Line constants.
* lib/rdoc/ri: Allow output IO to be specified. * test/rdoc/parser/test_parse_c.rb: Move up one level, fixed. * test/rdoc/parser/test_rdoc_markup_attribute_manager.rb: Renamed to match new class name, updated to match new classes. * test/rdoc/test_rdoc_ri_formatter.rb: Start of RI formatting tests. * test/rdoc/test_rdoc_ri_attribute_manager.rb: Start of RDoc::RI::AttributeManager tests. * test/rdoc/test_simple_markup.rb: Moved to match new class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9872d4d600
commit
8d37cefaf8
15 changed files with 443 additions and 261 deletions
|
@ -6,12 +6,12 @@ require 'cgi'
|
|||
class RDoc::Markup::ToHtml
|
||||
|
||||
LIST_TYPE_TO_HTML = {
|
||||
RDoc::Markup::ListBase::BULLET => [ "<ul>", "</ul>" ],
|
||||
RDoc::Markup::ListBase::NUMBER => [ "<ol>", "</ol>" ],
|
||||
RDoc::Markup::ListBase::UPPERALPHA => [ "<ol>", "</ol>" ],
|
||||
RDoc::Markup::ListBase::LOWERALPHA => [ "<ol>", "</ol>" ],
|
||||
RDoc::Markup::ListBase::LABELED => [ "<dl>", "</dl>" ],
|
||||
RDoc::Markup::ListBase::NOTE => [ "<table>", "</table>" ],
|
||||
:BULLET => [ "<ul>", "</ul>" ],
|
||||
:NUMBER => [ "<ol>", "</ol>" ],
|
||||
:UPPERALPHA => [ "<ol>", "</ol>" ],
|
||||
:LOWERALPHA => [ "<ol>", "</ol>" ],
|
||||
:LABELED => [ "<dl>", "</dl>" ],
|
||||
:NOTE => [ "<table>", "</table>" ],
|
||||
}
|
||||
|
||||
InlineTag = Struct.new(:bit, :on, :off)
|
||||
|
@ -241,22 +241,22 @@ class RDoc::Markup::ToHtml
|
|||
|
||||
def list_item_start(am, fragment)
|
||||
case fragment.type
|
||||
when RDoc::Markup::ListBase::BULLET, RDoc::Markup::ListBase::NUMBER then
|
||||
when :BULLET, :NUMBER then
|
||||
annotate("<li>")
|
||||
|
||||
when RDoc::Markup::ListBase::UPPERALPHA then
|
||||
when :UPPERALPHA then
|
||||
annotate("<li type=\"A\">")
|
||||
|
||||
when RDoc::Markup::ListBase::LOWERALPHA then
|
||||
when :LOWERALPHA then
|
||||
annotate("<li type=\"a\">")
|
||||
|
||||
when RDoc::Markup::ListBase::LABELED then
|
||||
when :LABELED then
|
||||
annotate("<dt>") +
|
||||
convert_flow(am.flow(fragment.param)) +
|
||||
annotate("</dt>") +
|
||||
annotate("<dd>")
|
||||
|
||||
when RDoc::Markup::ListBase::NOTE then
|
||||
when :NOTE then
|
||||
annotate("<tr>") +
|
||||
annotate("<td valign=\"top\">") +
|
||||
convert_flow(am.flow(fragment.param)) +
|
||||
|
@ -269,13 +269,11 @@ class RDoc::Markup::ToHtml
|
|||
|
||||
def list_end_for(fragment_type)
|
||||
case fragment_type
|
||||
when RDoc::Markup::ListBase::BULLET, RDoc::Markup::ListBase::NUMBER,
|
||||
RDoc::Markup::ListBase::UPPERALPHA,
|
||||
RDoc::Markup::ListBase::LOWERALPHA then
|
||||
when :BULLET, :NUMBER, :UPPERALPHA, :LOWERALPHA then
|
||||
"</li>"
|
||||
when RDoc::Markup::ListBase::LABELED then
|
||||
when :LABELED then
|
||||
"</dd>"
|
||||
when RDoc::Markup::ListBase::NOTE then
|
||||
when :NOTE then
|
||||
"</td></tr>"
|
||||
else
|
||||
raise "Invalid list type"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue