Class: Tilt::CreoleTemplate

Inherits:
Template show all
Defined in:
lib/tilt/creole.rb

Overview

Creole implementation. See: www.wikicreole.org/

Instance Attribute Summary

Attributes inherited from Template

#data, #file, #line, #options

Instance Method Summary collapse

Methods inherited from Template

#basename, default_mime_type, default_mime_type=, #eval_file, #initialize, metadata, #metadata, #name, #render

Constructor Details

This class inherits a constructor from Tilt::Template

Instance Method Details

#allows_script?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/tilt/creole.rb', line 21

def allows_script?
  false
end

#evaluate(scope, locals, &block) ⇒ Object



17
18
19
# File 'lib/tilt/creole.rb', line 17

def evaluate(scope, locals, &block)
  @output ||= @engine.to_html
end

#prepareObject



8
9
10
11
12
13
14
15
# File 'lib/tilt/creole.rb', line 8

def prepare
  opts = {}
  [:allowed_schemes, :extensions, :no_escape].each do |k|
    opts[k] = options[k] if options[k]
  end
  @engine = Creole::Parser.new(data, opts)
  @output = nil
end