  Registering custom filters
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  Once you've written your filter definition, you need to register it with
  your ``Library`` instance, to make it available to Django's template language::
  
      register.filter('cut', cut)
      register.filter('lower', lower)
  
  The ``Library.filter()`` method takes two arguments:
 
</s> remove in "Writing custom template filters" above. Example::
 </s> add in "Writing custom template filters" above. Example:

.. code-block:: python </s> remove     given template, so we need to be careful not to clobber another node's state
    information. The easiest way to do this is to always use ``self`` as the key
    into ``render_context``. If you're keeping track of several state variables,
    make ``render_context[self]`` a dictionary.
 </s> add     given template, so we need to be careful not to clobber another node's
    state information. The easiest way to do this is to always use ``self`` as
    the key into ``render_context``. If you're keeping track of several state
    variables, make ``render_context[self]`` a dictionary. </s> remove available to your templates using the ``{% load %}`` tag.
 </s> add available to your templates using the :ttag:`{% load %}<load>` tag. </s> remove     Any variable set in the context will only be available in the same ``block``
    of the template in which it was assigned. This behavior is intentional;
    it provides a scope for variables so that they don't conflict with
    context in other blocks.
 </s> add     Any variable set in the context will only be available in the same
    ``block`` of the template in which it was assigned. This behavior is
    intentional; it provides a scope for variables so that they don't conflict
    with context in other blocks. </s> remove        your filter function and set it to ``True``, like so::
 </s> add        your filter function and set it to ``True``, like so:

       .. code-block:: python
your ``Library`` instance, to make it available to Django's template language:

.. code-block:: python
  Registering custom filters
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  Once you've written your filter definition, you need to register it with
your ``Library`` instance, to make it available to Django's template language:

.. code-block:: python
  
      register.filter('cut', cut)
      register.filter('lower', lower)
  
  The ``Library.filter()`` method takes two arguments:
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