Sha256: 6b1d7b8f2fffca92e452fe77e14ac99dfc630767e7c61887acdef4921c6be590

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

module Slim
  # Slim engine which transforms slim code to executable ruby code
  # @api public
  class Engine < Temple::Engine
    # Allow users to set default options, particularly useful in Rails' environment files.
    # For instance, in config/environments/development.rb you probably want:
    #     # Indent html for pretty debugging
    #     Slim::Engine.set_default_options :pretty => true
    #
    set_default_options :pretty => false,
                        :attr_wrapper => '"',
                        :format => :html5,
                        :id_delimiter => nil,
                        :generator => Temple::Generators::ArrayBuffer

    use Slim::Parser, :file, :tabsize
    use Slim::EmbeddedEngine, :enable_engines, :disable_engines
    use Slim::Interpolation
    use Slim::Sections, :sections, :dictionary, :dictionary_access
    use Slim::EndInserter
    use Slim::Compiler
    filter :EscapeHTML, :use_html_safe
    use Temple::HTML::Pretty, :format, :attr_wrapper, :id_delimiter, :pretty
    filter :MultiFlattener
    filter :StaticMerger
    filter :DynamicInliner
    chain << proc {|options| options[:generator].new }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slim-0.8.1 lib/slim/engine.rb
slim-0.8.0 lib/slim/engine.rb
slim-0.7.4 lib/slim/engine.rb