diff --git a/lib/haml.rb b/lib/haml.rb
index 3e3a8efc..cd0d3ca8 100644
--- a/lib/haml.rb
+++ b/lib/haml.rb
@@ -530,6 +530,20 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
#
+#
I really prefer raspberry jam.
+#
+#
# Haml has the following filters defined:
#
# [plain] Does not parse the filtered text.
diff --git a/lib/haml/filters.rb b/lib/haml/filters.rb
index 74349fbf..fbf7488d 100644
--- a/lib/haml/filters.rb
+++ b/lib/haml/filters.rb
@@ -1,19 +1,57 @@
# This file contains redefinitions of and wrappers around various text
# filters so they can be used as Haml filters.
-# :stopdoc:
-
-begin
- require 'rubygems'
-rescue LoadError; end
-
module Haml
+ # The module containing the default filters,
+ # as well as the base module,
+ # Haml::Filters::Base.
module Filters
+ # The base module for Haml filters.
+ # User-defined filters should be modules including this module.
+ #
+ # A user-defined filter should override either Base#render or Base #compile.
+ # Base#render is the most common.
+ # It takes a string, the filter source,
+ # and returns another string,
+ # the result of the filter.
+ # For example:
+ #
+ # module Haml::Filters::Sass
+ # include Haml::Filters::Base
+ #
+ # def render(text)
+ # ::Sass::Engine.new(text).render
+ # end
+ # end
+ #
+ # For details on overriding #compile, see its documentation.
+ #
module Base
- def self.included(base)
+ def self.included(base) # :nodoc:
base.extend(base)
end
+ # Takes a string, the source text that should be passed to the filter,
+ # and returns the string resulting from running the filter on