Class: Malt::Engine::Maruku
- Defined in:
- lib/malt/engines/maruku.rb
Overview
Redcarpet Markdown implementation.
http://maruku.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.
55 56 57 58 59 60 |
# File 'lib/malt/engines/maruku.rb', line 55 def create_engine(params={}) text = parameters(params, :text) opts = (params) ::Maruku.new(text, opts) end |
#render(params = {}) ⇒ Object
Convert Markdown text to HTML text.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/malt/engines/maruku.rb', line 23 def render(params={}) into, text, part = parameters(params, :to, :text, :partial) engine = prepare_engine(params) case into when :html, nil if part engine.to_html else engine.to_html_document end when :latex #, :pdf if part engine.to_latex else engine.to_latex_document end else super(params) end end |