class Malt::Engine::WikiCloth

WikiCloth is a MediaWiki format for Ruby. Unlike Creole, WikiCloth
also supports variable interpolation.

@see code.google.com/p/wikicloth/

Public Instance Methods

create_engine(params={}) click to toggle source
# File lib/malt/engines/wikicloth.rb, line 29
def create_engine(params={})
  text = parameters(params, :text)

  cached(text) do
    ::WikiCloth::WikiCloth.new(:data => text)
  end
end
render(params={}, &content) click to toggle source
Calls superclass method Malt::Engine::Abstract#render
# File lib/malt/engines/wikicloth.rb, line 15
def render(params={}, &content)
  scope, locals = parameters(params, :scope, :locals)

  data = make_hash(scope, locals, &content)

  case params[:to]
  when :html, nil
    prepare_engine(params).to_html(:params => data)
  else
    super(params)
  end
end

Private Instance Methods

require_engine() click to toggle source

Load `wikicloth` library if not already loaded.

# File lib/malt/engines/wikicloth.rb, line 40
def require_engine
  return if defined? ::WikiCloth
  require_library 'wikicloth'
end