Sha256: b28617b83104653637ca218a8007f30e9cbadd802d31255e8b4c75bd4384bd00
Contents?: true
Size: 686 Bytes
Versions: 5
Compression:
Stored size: 686 Bytes
Contents
module Workbench # Parse HAML file with options class HamlRenderer DEFAULT_HAML_OPTIONS = { :escape_attrs => true, :attr_wrapper => '"', :format => :html4 } class << self # Parse HAML file with options # # @param [String] filename path to file # @param [Hash] options options # @return [String] parsed content # # @example # result = Workbench::HamlRenderer.render 'index.haml', { :attr_wrapper => "'", :escape_attrs => false } # def render filename, options = {} Haml::Engine.new(File.read(filename), DEFAULT_HAML_OPTIONS.merge(options)).render end end end end
Version data entries
5 entries across 5 versions & 1 rubygems