Commit 89b65d48 by Steven Cummings Committed by Timothée Peignier

cssmin compressor

Including doc and a correction to the sample custom compressor.
parent 216fb020
......@@ -142,6 +142,18 @@ To us it for your stylesheets add this to your ``PIPELINE_CSS_COMPRESSOR`` ::
Default to ``'--template=highest'``
cssmin compressor
=================
The cssmin compressor uses the `cssmin <http://pypi.python.org/pypi/cssmin/>`_
Python library to compress stylesheets. To use it, specify this
``PIPELINE_CSS_COMPRESSOR`` ::
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.cssmin.CssminCompressor'
Install the cssmin library with your favorite Python package manager. E.g. ::
pip install cssmin
Write your own compressor class
===============================
......@@ -166,7 +178,7 @@ A custom compressor for a imaginary compressor called jam ::
def compress_js(self, js):
return jam.compress(js)
def compress(self, css):
def compress_css(self, css):
return jam.compress(css)
......
from pipeline.compressors import CompressorBase
class CssminCompressor(CompressorBase):
"""
CSS compressor based on the Python library cssmin
(http://pypi.python.org/pypi/cssmin/).
"""
def compress_css(self, css):
from cssmin import cssmin
return cssmin(css)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment