2008-01-18 19:06:19 -05:00
|
|
|
require 'rdoc/markup'
|
2008-02-09 22:59:08 -05:00
|
|
|
require 'rdoc/markup/formatter'
|
2008-01-18 19:06:19 -05:00
|
|
|
|
|
|
|
##
|
|
|
|
# This Markup outputter is used for testing purposes.
|
|
|
|
|
2008-02-09 22:59:08 -05:00
|
|
|
class RDoc::Markup::ToTest < RDoc::Markup::Formatter
|
2008-01-18 19:06:19 -05:00
|
|
|
|
|
|
|
def start_accepting
|
|
|
|
@res = []
|
|
|
|
end
|
|
|
|
|
|
|
|
def end_accepting
|
|
|
|
@res
|
|
|
|
end
|
|
|
|
|
|
|
|
def accept_paragraph(am, fragment)
|
|
|
|
@res << fragment.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def accept_verbatim(am, fragment)
|
|
|
|
@res << fragment.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def accept_list_start(am, fragment)
|
|
|
|
@res << fragment.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def accept_list_end(am, fragment)
|
|
|
|
@res << fragment.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def accept_list_item(am, fragment)
|
|
|
|
@res << fragment.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def accept_blank_line(am, fragment)
|
|
|
|
@res << fragment.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def accept_heading(am, fragment)
|
|
|
|
@res << fragment.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def accept_rule(am, fragment)
|
|
|
|
@res << fragment.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|