Class: Tilt::CreoleTemplate
Overview
Instance Attribute Summary
Attributes inherited from Template
#data, #file, #line, #options
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Template
#basename, #default_encoding, #eval_file, #initialize, #name, #read_template_file, #render
Constructor Details
This class inherits a constructor from Tilt::Template
Class Method Details
.engine_initialized? ⇒ Boolean
7
8
9
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/wiki.rb', line 7
def self.engine_initialized?
defined? ::Creole
end
|
Instance Method Details
#allows_script? ⇒ Boolean
28
29
30
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/wiki.rb', line 28
def allows_script?
false
end
|
#evaluate(scope, locals, &block) ⇒ Object
24
25
26
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/wiki.rb', line 24
def evaluate(scope, locals, &block)
@output ||= @engine.to_html
end
|
#initialize_engine ⇒ Object
11
12
13
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/wiki.rb', line 11
def initialize_engine
require_template_library 'creole'
end
|
15
16
17
18
19
20
21
22
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/wiki.rb', line 15
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
|