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 744
744:     def evaluate(scope, locals, &block)
745:       @output ||= @engine.to_html
746:     end

[Source]

     # File lib/tilt.rb, line 730
730:     def flags
731:       [:smart, :filter_html].select { |flag| options[flag] }
732:     end

[Source]

     # File lib/tilt.rb, line 734
734:     def initialize_engine
735:       return if defined? ::RDiscount
736:       require_template_library 'rdiscount'
737:     end

[Source]

     # File lib/tilt.rb, line 739
739:     def prepare
740:       @engine = RDiscount.new(data, *flags)
741:       @output = nil
742:     end

[Validate]