Class: Tilt::FormdownTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/tilt/formdown.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean

DUMB_QUOTES = [39, 39, 34, 34]

Returns:

  • (Boolean)


8
9
10
# File 'lib/tilt/formdown.rb', line 8

def self.engine_initialized?
  defined? ::Formdown
end

Instance Method Details

#allows_script?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/tilt/formdown.rb', line 27

def allows_script?
  false
end

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



23
24
25
# File 'lib/tilt/formdown.rb', line 23

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

#initialize_engineObject



12
13
14
# File 'lib/tilt/formdown.rb', line 12

def initialize_engine
  require_template_library 'formdown'
end

#prepareObject



16
17
18
19
20
21
# File 'lib/tilt/formdown.rb', line 16

def prepare
  # options[:smart_quotes] = DUMB_QUOTES unless options[:smartypants]
  # @engine = Formdown::Document.new(data, options)
  @engine = Formdown::Renderer.new(data)
  @output = nil
end