Class: Nanoc3::Filters::RDoc
- Inherits:
-
Nanoc3::Filter
- Object
- Context
- Nanoc3::Filter
- Nanoc3::Filters::RDoc
- Defined in:
- lib/nanoc3/filters/rdoc.rb
Constant Summary
Constants inherited from Nanoc3::Filter
Instance Attribute Summary
Attributes inherited from Nanoc3::Filter
Instance Method Summary (collapse)
-
- (String) run(content, params = {})
Runs the content through RDoc::Markup.
Methods inherited from Nanoc3::Filter
#filename, from_binary?, #initialize, #output_filename, to_binary?, type
Methods included from PluginRegistry::PluginMethods
#identifier, #identifiers, #named, #register
Methods inherited from Context
Constructor Details
This class inherits a constructor from Nanoc3::Filter
Instance Method Details
- (String) run(content, params = {})
Runs the content through RDoc::Markup. This method takes no options.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/nanoc3/filters/rdoc.rb', line 12 def run(content, params={}) begin # new RDoc require 'rdoc/markup' require 'rdoc/markup/to_html' ::RDoc::Markup.new.convert(content, ::RDoc::Markup::ToHtml.new) rescue LoadError # old RDoc require 'rdoc/markup/simple_markup' require 'rdoc/markup/simple_markup/to_html' ::SM::SimpleMarkup.new.convert(content, ::SM::ToHtml.new) end end |