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 84 def allows_script? 85 false 86 end
evaluate(scope, locals, &block)
click to toggle source
# File lib/tilt/commonmarker.rb 79 def evaluate(scope, locals, &block) 80 doc = CommonMarker.render_doc(data, parse_options, extensions) 81 doc.to_html(render_options, extensions) 82 end
extensions()
click to toggle source
# File lib/tilt/commonmarker.rb 39 def extensions 40 EXTENSIONS.select do |extension| 41 options[extension] 42 end 43 end
parse_options()
click to toggle source
# File lib/tilt/commonmarker.rb 45 def parse_options 46 raw_options = PARSE_OPTIONS.select do |option| 47 options[option] 48 end 49 actual_options = raw_options.map do |option| 50 OPTION_ALIAS[option] || option 51 end 52 53 if actual_options.any? 54 actual_options 55 else 56 :DEFAULT 57 end 58 end
prepare()
click to toggle source
# File lib/tilt/commonmarker.rb 74 def prepare 75 @engine = nil 76 @output = nil 77 end
render_options()
click to toggle source
# File lib/tilt/commonmarker.rb 60 def render_options 61 raw_options = RENDER_OPTIONS.select do |option| 62 options[option] 63 end 64 actual_options = raw_options.map do |option| 65 OPTION_ALIAS[option] || option 66 end 67 if actual_options.any? 68 actual_options 69 else 70 :DEFAULT 71 end 72 end