Sha256: 1dffef72acd49c7f1e6de43236c7dfcd291b53c5b7525db25cc0838a27a9dcbe

Contents?: true

Size: 604 Bytes

Versions: 1

Compression:

Stored size: 604 Bytes

Contents

module Markerb
  mattr_accessor :processing_options, :renderer
  @@processing_options = {}

  class Markdown
    def self.to_html(compiled_source)
      if defined?(Redcarpet)
        Markerb.renderer ||= Redcarpet::Render::HTML
        Redcarpet::Markdown.new(Markerb.renderer, Markerb.processing_options).render(compiled_source)
      elsif defined?(Kramdown)
        Kramdown::Document.new(compiled_source, Markerb.processing_options).to_html
      else
        raise StandardError, "Markdown processor unavailable, please add either Redcarpet or Kramdown to your project"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
markerb-1.1.0 lib/markerb/markdown.rb