Class Tilt::RDiscountTemplate
In: lib/tilt.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.

Methods

Public Instance methods

[Source]

     # File lib/tilt.rb, line 750
750:     def evaluate(scope, locals, &block)
751:       @output ||= @engine.to_html
752:     end

[Source]

     # File lib/tilt.rb, line 736
736:     def flags
737:       [:smart, :filter_html].select { |flag| options[flag] }
738:     end

[Source]

     # File lib/tilt.rb, line 740
740:     def initialize_engine
741:       return if defined? ::RDiscount
742:       require_template_library 'rdiscount'
743:     end

[Source]

     # File lib/tilt.rb, line 745
745:     def prepare
746:       @engine = RDiscount.new(data, *flags)
747:       @output = nil
748:     end

[Validate]