NewsBlur/utils/djangocompress/docs/Customization.textile
2009-09-08 03:37:17 +00:00

11 lines
No EOL
1 KiB
Text

h1. Customization
_Describes how to customize and add your own functionality to django-compress_
django-compress can be customized an a couple of ways.
If you need to change the output of the HTML-tags generated from the templatetags, this can be done by overriding the templates <tt>compress/css.html</tt> and <tt>compress/js.html</tt>.
You can also write your own filter-class, if you for example want to implement other types of compressors. All you need to do is to define a filter_css and/or a filter_js functions in a class that inherits from <tt>compress.filter_base.FilterBase</tt>, and specify it in the tuple of filters (<tt>COMPRESS_CSS_FILTERS</tt>/<tt>COMPRESS_JS_FILTERS</tt>) (see [Configuration] for more information) in the settings.
For now, see the files under [http://django-compress.googlecode.com/svn/trunk/filters/ filters/] for more details. CSSTidyFilter uses and external program, and JSMinCompressor just calls a Python-function, so it will probably be able to point you in the right direction when writing custom filters.