Class: Slim::Template

Inherits:
Object
  • Object
show all
Includes:
SafeTemplate
Defined in:
lib/middleman-core/renderers/slim.rb

Instance Method Summary collapse

Methods included from SafeTemplate

#render

Constructor Details

#initialize(file, line, opts, &block) ⇒ Template

Returns a new instance of Template.



13
14
15
16
17
18
19
20
21
22
# File 'lib/middleman-core/renderers/slim.rb', line 13

def initialize(file, line, opts, &block)
  if opts.key?(:context)
    ::Slim::Embedded::SassEngine.disable_option_validator!
    %w(sass scss markdown).each do |engine|
      (::Slim::Embedded.options[engine.to_sym] ||= {})[:context] = opts[:context]
    end
  end

  super
end

Instance Method Details

#precompiled_preamble(locals) ⇒ Object



24
25
26
# File 'lib/middleman-core/renderers/slim.rb', line 24

def precompiled_preamble(locals)
  "__in_slim_template = true\n" << super
end