Class: Middleman::Renderers::Slim

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

Overview

Slim renderer

Constant Summary

Constants included from Contracts

Contracts::PATH_MATCHER

Instance Attribute Summary

Attributes inherited from Extension

#app, #options

Instance Method Summary collapse

Methods inherited from Extension

activated_extension, #add_exposed_to_context, #after_build, #after_configuration, #after_extension_activated, after_extension_activated, #before_build, #before_configuration, clear_after_extension_callbacks, config, define_setting, expose_to_application, expose_to_config, expose_to_template, global_config, helpers, #manipulate_resource_list, option, #ready, resources

Methods included from Contracts

#Contract

Constructor Details

#initialize(_app, _options = {}, &_block) ⇒ Slim

Setup extension



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/middleman-core/renderers/slim.rb', line 34

def initialize(_app, _options={}, &_block)
  super

  # Setup Slim options to work with partials
  ::Slim::Engine.disable_option_validator!
  ::Slim::Engine.set_options(
    buffer: '@_out_buf',
    use_html_safe: true,
    generator: ::Temple::Generators::RailsOutputBuffer,
    disable_escape: true
  )
end