Class: Tilt::KramdownTemplate

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

Overview

Kramdown Markdown implementation. See: kramdown.rubyforge.org/

Constant Summary collapse

DUMB_QUOTES =
[39, 39, 34, 34]

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)


20
21
22
# File 'lib/tilt/kramdown.rb', line 20

def allows_script?
  false
end

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



16
17
18
# File 'lib/tilt/kramdown.rb', line 16

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

#prepareObject



10
11
12
13
14
# File 'lib/tilt/kramdown.rb', line 10

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