Class: Tilt::KramdownTemplate
- Inherits:
-
Template
show all
- Defined in:
- lib/vendor/tilt-1.4.1/lib/tilt/markdown.rb
Overview
Constant Summary
collapse
- DUMB_QUOTES =
[39, 39, 34, 34]
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
191
192
193
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/markdown.rb', line 191
def self.engine_initialized?
defined? ::Kramdown
end
|
Instance Method Details
#allows_script? ⇒ Boolean
209
210
211
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/markdown.rb', line 209
def allows_script?
false
end
|
#evaluate(scope, locals, &block) ⇒ Object
205
206
207
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/markdown.rb', line 205
def evaluate(scope, locals, &block)
@output ||= @engine.to_html
end
|
#initialize_engine ⇒ Object
195
196
197
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/markdown.rb', line 195
def initialize_engine
require_template_library 'kramdown'
end
|
199
200
201
202
203
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/markdown.rb', line 199
def prepare
options[:smart_quotes] = DUMB_QUOTES unless options[:smartypants]
@engine = Kramdown::Document.new(data, options)
@output = nil
end
|