Sha256: 046bf62894bfd83aee067dfcd405f54f16194f3d4167b350c458d16de60f70b1

Contents?: true

Size: 519 Bytes

Versions: 14

Compression:

Stored size: 519 Bytes

Contents

# encoding: utf-8

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

    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

14 entries across 14 versions & 1 rubygems

Version Path
nanoc3-3.1.0b1 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.0a3 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.9 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.8 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.0a2 lib/nanoc3/filters/rdoc.rb
nanoc3-3.1.0a1 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.7 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.6 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.5 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.4 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.3 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.2 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.1 lib/nanoc3/filters/rdoc.rb
nanoc3-3.0.0 lib/nanoc3/filters/rdoc.rb