Class: Malt::Engine::Kramdown
- Defined in:
- lib/malt/engines/kramdown.rb
Overview
Kramdown Markdown implementation.
http://kramdown.rubyforge.org/
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
-
#create_engine(params = {}) ⇒ Object
Convert Markdown text to intermediate object.
-
#render(params = {}) ⇒ Object
Convert Markdown text to HTML text.
Methods inherited from Abstract
#cache?, default, #initialize, #prepare_engine, register, type
Constructor Details
This class inherits a constructor from Malt::Engine::Abstract
Instance Method Details
#create_engine(params = {}) ⇒ Object
Convert Markdown text to intermediate object.
41 42 43 44 45 46 |
# File 'lib/malt/engines/kramdown.rb', line 41 def create_engine(params={}) text = parameters(params, :text) cached(text) do ::Kramdown::Document.new(text) end end |
#render(params = {}) ⇒ Object
Convert Markdown text to HTML text.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/malt/engines/kramdown.rb', line 27 def render(params={}) into, text = parameters(params, :to, :text) case into when :html, nil prepare_engine(params).to_html when :latex prepare_engine(params).to_latex else super(params) end end |