class Tilt::CommonMarkerTemplate

Constants

EXTENSIONS
OPTION_ALIAS
PARSE_OPTIONS
RENDER_OPTIONS

Public Instance Methods

allows_script?() click to toggle source
   # File lib/tilt/commonmarker.rb
74 def allows_script?
75   false
76 end
evaluate(scope, locals, &block) click to toggle source
   # File lib/tilt/commonmarker.rb
69 def evaluate(scope, locals, &block)
70   doc = CommonMarker.render_doc(data, parse_options, extensions)
71   doc.to_html(render_options, extensions)
72 end
extensions() click to toggle source
   # File lib/tilt/commonmarker.rb
29 def extensions
30   EXTENSIONS.select do |extension|
31     options[extension]
32   end
33 end
parse_options() click to toggle source
   # File lib/tilt/commonmarker.rb
35 def parse_options
36   raw_options = PARSE_OPTIONS.select do |option|
37     options[option]
38   end
39   actual_options = raw_options.map do |option|
40     OPTION_ALIAS[option] || option
41   end
42 
43   if actual_options.any?
44     actual_options
45   else
46     :DEFAULT
47   end
48 end
prepare() click to toggle source
   # File lib/tilt/commonmarker.rb
64 def prepare
65   @engine = nil
66   @output = nil
67 end
render_options() click to toggle source
   # File lib/tilt/commonmarker.rb
50 def render_options
51   raw_options = RENDER_OPTIONS.select do |option|
52     options[option]
53   end
54   actual_options = raw_options.map do |option|
55     OPTION_ALIAS[option] || option
56   end
57   if actual_options.any?
58     actual_options
59   else
60     :DEFAULT
61   end
62 end