Sha256: 6f36e84d628a7ff33b56e4c79bd2bef8469dfd9d2ae24082ec97f22257d9fbb8

Contents?: true

Size: 516 Bytes

Versions: 4

Compression:

Stored size: 516 Bytes

Contents

module Slinky
  module HamlCompiler
    Compilers.register_compiler self,
      :inputs => ["haml"],
      :outputs => ["html"],
      :dependencies => [["haml", "~> 3.1.0"]]

    def HamlCompiler::compile s, file
      haml_engine = Haml::Engine.new(s)
      haml_engine.render
    end

    # escape should return a string that can be inserted into the
    # document in such a way that after compilation the string will be
    # intact in the final output.
    def HamlCompiler::escape s
      s
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
slinky-0.7.3 lib/slinky/compilers/haml-compiler.rb
slinky-0.7.2 lib/slinky/compilers/haml-compiler.rb
slinky-0.7.1 lib/slinky/compilers/haml-compiler.rb
slinky-0.7.0 lib/slinky/compilers/haml-compiler.rb