Class: Slim::Template
- Inherits:
-
Object
- Object
- Slim::Template
- Includes:
- SafeTemplate
- Defined in:
- lib/middleman-core/renderers/slim.rb
Instance Method Summary collapse
-
#initialize(file, line, opts, &block) ⇒ Template
constructor
A new instance of Template.
- #precompiled_preamble(locals) ⇒ Object
Methods included from SafeTemplate
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.[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 |