Class: Tilt::RedcarpetTemplate

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

Overview

Upskirt Markdown implementation. See: github.com/tanoku/redcarpet

Supports both Redcarpet 1.x and 2.x

Constant Summary

Redcarpet1 =
Redcarpet1Template
Redcarpet2 =
Redcarpet2Template

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

- (Boolean) allows_script?



98
99
100
# File 'lib/tilt/redcarpet.rb', line 98

def allows_script?
  false
end

- (Object) evaluate(scope, locals, &block)



94
95
96
# File 'lib/tilt/redcarpet.rb', line 94

def evaluate(scope, locals, &block)
  @engine.evaluate(scope, locals, &block)
end

- (Object) prepare



89
90
91
92
# File 'lib/tilt/redcarpet.rb', line 89

def prepare
  klass = Redcarpet2.engine_initialized? ? Redcarpet2 : Redcarpet1
  @engine = klass.new(file, line, options) { data }
end