Class: Malt::Engine::Creole
- Defined in:
- lib/malt/engines/creole.rb
Overview
Creole is a MediaWiki format for Ruby.
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
- #create_engine(params = {}) ⇒ Object
-
#render(params = {}, &content) ⇒ Object
Convert WikiMedia format to HTML.
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
32 33 34 35 36 37 38 39 |
# File 'lib/malt/engines/creole.rb', line 32 def create_engine(params={}) text = parameters(params, :text) opts = (params) cached(opts, text) do ::Creole::Parser.new(text, opts) end end |
#render(params = {}, &content) ⇒ Object
Convert WikiMedia format to HTML.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/malt/engines/creole.rb', line 15 def render(params={}, &content) into = parameters(params, :to) case into when :html, nil prepare_engine(params, &content).to_html else super(params) end end |