Sha256: 8428c127b796a9b3f6966457e743ae7974a6ee0de47969b51742dec261f15ed5

Contents?: true

Size: 508 Bytes

Versions: 23

Compression:

Stored size: 508 Bytes

Contents

module Plate
  # Generic markdown template, currently uses RedCarpet2
  class MarkdownTemplate < Tilt::Template
    self.default_mime_type = 'text/html'

    def self.engine_initialized?
      defined? ::Redcarpet::Render
    end

    def initialize_engine
      require_template_library 'redcarpet'
    end

    def prepare
      @engine = ::Redcarpet::Markdown.new(Redcarpet::Render::HTML, options)
    end
  
    def evaluate(scope, locals, &block)
      @output ||= @engine.render(data)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
plate-0.7.8 lib/plate/markdown_template.rb
plate-0.7.7 lib/plate/markdown_template.rb
plate-0.7.6 lib/plate/markdown_template.rb
plate-0.7.5 lib/plate/markdown_template.rb
plate-0.7.4 lib/plate/markdown_template.rb
plate-0.7.3 lib/plate/markdown_template.rb
plate-0.7.2 lib/plate/markdown_template.rb
plate-0.7.1 lib/plate/markdown_template.rb
plate-0.7.0 lib/plate/markdown_template.rb
plate-0.7.0.pre5 lib/plate/markdown_template.rb
plate-0.7.0.pre4 lib/plate/markdown_template.rb
plate-0.7.0.pre3 lib/plate/markdown_template.rb
plate-0.7.0.pre2 lib/plate/markdown_template.rb
plate-0.7.0.pre lib/plate/markdown_template.rb
plate-0.6.3 lib/plate/markdown_template.rb
plate-0.6.2 lib/plate/markdown_template.rb
plate-0.6.1 lib/plate/markdown_template.rb
plate-0.6.0 lib/plate/markdown_template.rb
plate-0.5.4 lib/plate/markdown_template.rb
plate-0.5.3 lib/plate/markdown_template.rb