Commit 337d7224 by Timothée Peignier

Merge pull request #128 from brantyoung/master

add support for slimit compressor
parents 2b8dc5cb 37fb925b
......@@ -36,3 +36,5 @@ or just made Pipeline more awesome.
* Steven Cummings <estebistec@gmail.com>
* Timothée Peignier <timothee.peignier@tryphon.org>
* Trey Smith <trey.smith@nasa.gov>
* Brant Young <brant.young@gmail.com>
......@@ -122,6 +122,21 @@ Install the jsmin library with your favorite Python package manager ::
pip install jsmin
SlimIt compressor
=================
The slimit compressor uses `SlimIt <http://slimit.org/>`_ to
compress javascripts.
To use it add this to your ``PIPELINE_JS_COMPRESSOR`` ::
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.slimit.SlimItCompressor'
Install the slimit library with your favorite Python package manager ::
pip install slimit
CSSTidy compressor
==================
......
from __future__ import absolute_import
from pipeline.compressors import CompressorBase
class SlimItCompressor(CompressorBase):
"""
JS compressor based on the Python library slimit
(http://pypi.python.org/pypi/slimit/).
"""
def compress_js(self, js):
from slimit import minify
return minify(js)
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