Class: Tilt::Redcarpet1Template
- Defined in:
- lib/tilt/redcarpet.rb
Overview
Compatibility mode for Redcarpet 1.x
Constant Summary collapse
- ALIAS =
{ :escape_html => :filter_html, :smartypants => :smart }
- FLAGS =
[:smart, :filter_html, :smartypants, :escape_html]
Instance Attribute Summary
Attributes inherited from Template
#compiled_path, #data, #file, #line, #options
Instance Method Summary collapse
- #allows_script? ⇒ Boolean
- #evaluate(scope, locals, &block) ⇒ Object
- #flags ⇒ Object
- #prepare ⇒ Object
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
29 30 31 |
# File 'lib/tilt/redcarpet.rb', line 29 def allows_script? false end |
#evaluate(scope, locals, &block) ⇒ Object
25 26 27 |
# File 'lib/tilt/redcarpet.rb', line 25 def evaluate(scope, locals, &block) @output ||= @engine.to_html end |
#flags ⇒ Object
16 17 18 |
# File 'lib/tilt/redcarpet.rb', line 16 def flags FLAGS.select { |flag| [flag] }.map { |flag| ALIAS[flag] || flag } end |
#prepare ⇒ Object
20 21 22 23 |
# File 'lib/tilt/redcarpet.rb', line 20 def prepare @engine = RedcarpetCompat.new(data, *flags) @output = nil end |