1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/rdoc/markup/to_test.rb
drbrain 455b051a00 * lib/rdoc/code_objects.rb: Make some attributes accessible for reuse.
* lib/rdoc/generator/html.rb: Pull out ContextUser classes and related
	  methods for reuse.
	* lib/rdoc/generator.rb: Move ContextUser classes to
	  RDoc::Generator::Context for reuse.
	* lib/rdoc/rdoc.rb: Make RDoc::RDoc initialization a little easier.
	* lib/rdoc/options.rb: Make RDoc::Options easier to use without
	  parsing an ARGV.
	* lib/rdoc/markup/to_*.rb: Subclass RDoc::Markup::Formatter.
	* lib/rdoc/markup/formatter.rb: Add RDoc::Markup::Formatter to make
	  RDoc markup conversion easier.
	* lib/rdoc/markup/fragments.rb: Make RDoc::Markup::ListItem easier to
	  test.
	* lib/rdoc/markup/to_html_hyperlink.rb: Pulled out of the HTML
	  generator for easier reusability.
	* lib/rdoc/markup.rb: Fix bug with labeled lists containing bullet
	  lists.
	* lib/rdoc/generators/html/html.rb: Fix Constant display.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-10 03:59:08 +00:00

50 lines
804 B
Ruby

require 'rdoc/markup'
require 'rdoc/markup/formatter'
##
# This Markup outputter is used for testing purposes.
class RDoc::Markup::ToTest < RDoc::Markup::Formatter
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