Class: Malt::Engine::Creole

Inherits:
Abstract show all
Defined in:
lib/malt/engines/creole.rb

Overview

Creole is a MediaWiki format for Ruby.

Instance Attribute Summary

Attributes inherited from Abstract

#settings

Instance Method Summary collapse

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 = engine_options(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