Sha256: 3aa3ed62426d50878252c182fff6b46cdc0d86663354d5e54e4340b8f79cf394

Contents?: true

Size: 786 Bytes

Versions: 13

Compression:

Stored size: 786 Bytes

Contents

module Apipie

  module Markup

    class RDoc

      def to_html(text)
        rdoc.convert(text)
      end

      private

      def rdoc
        @rdoc ||= begin
          require 'rdoc'
          require 'rdoc/markup/to_html'
          if Gem::Version.new(::RDoc::VERSION) < Gem::Version.new('4.0.0')
            ::RDoc::Markup::ToHtml.new()
          else
            ::RDoc::Markup::ToHtml.new(::RDoc::Options.new)
          end
        end
      end
    end

    class Markdown

      def initialize
        require 'maruku'
      end

      def to_html(text)
        Maruku.new(text).to_html
      end

    end

    class Textile

      def initialize
        require 'RedCloth'
      end

      def to_html(text)
        RedCloth.new(text).to_html
      end

    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
apipie-rails-0.9.2 lib/apipie/markup.rb
apipie-rails-0.9.1 lib/apipie/markup.rb
apipie-rails-0.9.0 lib/apipie/markup.rb
apipie-rails-0.8.2 lib/apipie/markup.rb
apipie-rails-0.8.1 lib/apipie/markup.rb
apipie-rails-0.8.0 lib/apipie/markup.rb
apipie-rails-0.7.2 lib/apipie/markup.rb
apipie-rails-0.7.1 lib/apipie/markup.rb
apipie-rails-0.7.0 lib/apipie/markup.rb
apipie-rails-0.6.0 lib/apipie/markup.rb
apipie-rails-0.5.20 lib/apipie/markup.rb
apipie-rails-0.5.19 lib/apipie/markup.rb
apipie-rails-0.5.18 lib/apipie/markup.rb