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 23 24 25 26 |
# File 'lib/middleman-core/renderers/slim.rb', line 13 def initialize(file, line, opts, &block) if opts.key?(:context) context_hack = { context: opts[:context] } ::Slim::Embedded::SassEngine.disable_option_validator! %w(sass scss markdown).each do |engine| ::Slim::Embedded.[engine.to_sym] = context_hack end end super end |
Instance Method Details
#precompiled_preamble(locals) ⇒ Object
28 29 30 |
# File 'lib/middleman-core/renderers/slim.rb', line 28 def precompiled_preamble(locals) "__in_slim_template = true\n" << super end |