Sha256: fac9c43a14e2192037e430401e54a5ce541086b5f0e04490bcf130e59e76d960

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 Bytes

Contents

module Nanoc2::Filters
  class RDoc < Nanoc2::Filter

    identifiers :rdoc

    def run(content)
      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

1 entries across 1 versions & 1 rubygems

Version Path
nanoc2-2.2.3 lib/nanoc2/filters/rdoc.rb