Custom Filters

Custom filters are just regular Python functions that take the left
side of the filter as first argument and the the arguments passed to
the filter as extra arguments or keyword arguments.

For example in the filter {{ 42|myfilter(23) }} the function would be
called with myfilter(42, 23).

You can register "myfilter" on the template environment by updating
the filters dict on the environment:

environment.filters['myfilter'] = myfilter

===> Does anyone have an example of the above?

===> Is "environment.filters" part of some builder object somewhere?

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to