Class: Plate::MarkdownTemplate
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- Plate::MarkdownTemplate
- Defined in:
- lib/plate/markdown_template.rb
Overview
Generic markdown template, currently uses RedCarpet2
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.engine_initialized? ⇒ Boolean
6 7 8 |
# File 'lib/plate/markdown_template.rb', line 6 def self.engine_initialized? defined? ::Redcarpet::Render end |
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
18 19 20 |
# File 'lib/plate/markdown_template.rb', line 18 def evaluate(scope, locals, &block) @output ||= @engine.render(data) end |
#initialize_engine ⇒ Object
10 11 12 |
# File 'lib/plate/markdown_template.rb', line 10 def initialize_engine require_template_library 'redcarpet' end |
#prepare ⇒ Object
14 15 16 |
# File 'lib/plate/markdown_template.rb', line 14 def prepare @engine = ::Redcarpet::Markdown.new(Redcarpet::Render::HTML, ) end |