Sha256: 12546eb9cd3d9f5bf0a1c2377aa2826c2e87f24c48b5305213b18f3da3da2ce0

Contents?: true

Size: 754 Bytes

Versions: 16

Compression:

Stored size: 754 Bytes

Contents

# encoding: utf-8

module Nanoc3::Filters
  class RDoc < Nanoc3::Filter

    # Runs the content through [RDoc::Markup](http://rdoc.rubyforge.org/RDoc/Markup.html).
    # This method takes no options.
    #
    # @param [String] content The content to filter
    #
    # @return [String] The filtered content
    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

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
nanoc3-3.1.9 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.8 lib/nanoc3/filters/rdoc.rb
nanoc3-3.2.0a4 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.7 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.6 lib/nanoc3/filters/rdoc.rb
nanoc3-3.2.0a3 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.5 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.4 lib/nanoc3/filters/rdoc.rb
nanoc3-3.2.0a2 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.3 lib/nanoc3/filters/rdoc.rb
nanoc3-3.2.0a1 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.2 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.1 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.0 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.0rc1 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.0b2 lib/nanoc3/filters/rdoc.rb