def register_tilt_filter(name, options = {})
      if constants.map(&:to_s).include?(name.to_s)
        raise "#{name} filter already defined"
      end

      filter = const_set(name, Module.new)
      filter.extend const_get(options[:extend] || "Plain")
      filter.extend TiltFilter
      filter.extend PrecompiledTiltFilter if options.has_key? :precompiled

      if options.has_key? :template_class
        filter.template_class = options[:template_class]
      else
        filter.tilt_extension = options.fetch(:extension) { name.downcase }
      end

      # All ":coffeescript" as alias for ":coffee", etc.
      if options.has_key?(:alias)
        [options[:alias]].flatten.each {|x| Filters.defined[x.to_s] = filter}
      end
      filter
    end
def register_tilt_filter(name, options = {})
      if constants.map(&:to_s).include?(name.to_s)
        raise "#{name} filter already defined"
      end

      filter = const_set(name, Module.new)
      filter.extend const_get(options[:extend] || "Plain")
      filter.extend TiltFilter
      filter.extend PrecompiledTiltFilter if options.has_key? :precompiled

      if options.has_key? :template_class
        filter.template_class = options[:template_class]
      else
        filter.tilt_extension = options.fetch(:extension) { name.downcase }
      end

      # All ":coffeescript" as alias for ":coffee", etc.
      if options.has_key?(:alias)
        [options[:alias]].flatten.each {|x| Filters.defined[x.to_s] = filter}
      end
      filter
    end
Loads an external template engine from
 [Tilt](https://github.com/rtomayko/tilt) as a filter. This method is used
 internally by Haml to set up filters for Sass, SCSS, Less, Coffeescript,
 and others. It's left public to make it easy for developers to add their
 own Tilt-based filters if they choose.

 @return [Module] The generated filter.
 @param [Hash] options Options for generating the filter module.
 @option options [Boolean] :precompiled Whether the filter should be
   precompiled. Erb, Nokogiri and Builder use this, for example.
 @option options [Class] :template_class The Tilt template class to use,
   in the event it can't be inferred from an extension.
 @option options [String] :extension The extension associated with the
   content, for example "markdown". This lets Tilt choose the preferred
   engine when there are more than one.
 @option options [String,Array<String>] :alias Any aliases for the filter.
   For example, :coffee is also available as :coffeescript.
 @option options [String] :extend The name of a module to extend when
   defining the filter. Defaults to "Plain". This allows filters such as
   Coffee to "inherit" from Javascript, wrapping its output in script tags.
 @since 4.0