  
  Here's an example filter definition::
  
      def cut(value, arg):
          "Removes all values of arg from the given string"
          return value.replace(arg, '')
  
  And here's an example of how that filter would be used:
  
  .. code-block:: html+django
 
</s> remove Here's an example filter definition::
 </s> add Here's an example filter definition:

.. code-block:: python </s> remove You can use ``register.filter()`` as a decorator instead::
 </s> add You can use ``register.filter()`` as a decorator instead:

.. code-block:: python </s> remove back to the main page. Here's what the Python function would look like::
 </s> add back to the main page. Here's what the Python function would look like:

.. code-block:: python </s> remove        For example, suppose you have a filter that adds the string ``xx`` to the
       end of any input. Since this introduces no dangerous HTML characters to
       the result (aside from any that were already present), you should mark
       your filter with ``is_safe``::
 </s> add        For example, suppose you have a filter that adds the string ``xx`` to
       the end of any input. Since this introduces no dangerous HTML characters
       to the result (aside from any that were already present), you should
       mark your filter with ``is_safe``:

       .. code-block:: python </s> remove outputting it::
 </s> add outputting it:

.. code-block:: python
        """Removes all values of arg from the given string"""
  
  Here's an example filter definition::
  
      def cut(value, arg):
        """Removes all values of arg from the given string"""
          return value.replace(arg, '')
  
  And here's an example of how that filter would be used:
  
  .. code-block:: html+django
keep keep keep keep replace keep keep keep keep keep
 Brushed up the custom template tag 'howto' guide by moving the assignment_tag doc to a more appropriate place (i.e. under the "Setting a variable in the context" section), adding cross references, fixing a few minor inaccuracies and doing a little PEP8 cleanup.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16909 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
docs/howto/custom-template-tags.txt