class Tilt::RDiscountTemplate

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.

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source
# File lib/tilt.rb, line 738
def evaluate(scope, locals, &block)
  @output ||= @engine.to_html
end
flags() click to toggle source
# File lib/tilt.rb, line 724
def flags
  [:smart, :filter_html].select { |flag| options[flag] }
end
initialize_engine() click to toggle source
# File lib/tilt.rb, line 728
def initialize_engine
  return if defined? ::RDiscount
  require_template_library 'rdiscount'
end
prepare() click to toggle source
# File lib/tilt.rb, line 733
def prepare
  @engine = RDiscount.new(data, *flags)
  @output = nil
end