Class | Tilt::RDiscountTemplate |
In: |
lib/tilt/markdown.rb
|
Parent: | Template |
Discount Markdown implementation. See: github.com/rtomayko/rdiscount
RDiscount is a simple text filter. It does not support scope or locals. The +:smart+ and +:filter_html+ options may be set true to enable those flags on the underlying RDiscount object.
ALIAS | = | { :escape_html => :filter_html, :smartypants => :smart |
FLAGS | = | [:smart, :filter_html, :smartypants, :escape_html] |
# File lib/tilt/markdown.rb, line 24 24: def self.engine_initialized? 25: defined? ::RDiscount 26: end
# File lib/tilt/markdown.rb, line 37 37: def evaluate(scope, locals, &block) 38: @output ||= @engine.to_html 39: end
# File lib/tilt/markdown.rb, line 20 20: def flags 21: FLAGS.select { |flag| options[flag] }.map { |flag| ALIAS[flag] || flag } 22: end