class Malt::Engine::Creole

Creole is a MediaWiki format for Ruby.

@see github.com/larsch/creole

Constants

ENGINE_OPTION_NAMES

Public Instance Methods

create_engine(params={}) click to toggle source
# 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) click to toggle source

Convert WikiMedia format to HTML.

Calls superclass method Malt::Engine::Abstract#render
# 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

Private Instance Methods

engine_option_names() click to toggle source
# File lib/malt/engines/creole.rb, line 53
def engine_option_names
  ENGINE_OPTION_NAMES
end
require_engine() click to toggle source

Load `creole` library if not already loaded.

# File lib/malt/engines/creole.rb, line 44
def require_engine
  return if defined? ::Creole
  require_library 'creole'
end