Skip to content

Commit

Permalink
Move pipeline settings into a dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
skolsuper authored and cyberdelia committed Dec 3, 2015
1 parent dd98239 commit 5aa0173
Show file tree
Hide file tree
Showing 30 changed files with 291 additions and 274 deletions.
50 changes: 25 additions & 25 deletions docs/compilers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ Coffee Script compiler
The Coffee Script compiler uses `Coffee Script <http://jashkenas.github.com/coffeescript/>`_
to compile your javascript.

To use it add this to your ``PIPELINE_COMPILERS`` ::
To use it add this to your ``PIPELINE['COMPILERS']`` ::

PIPELINE_COMPILERS = (
PIPELINE['COMPILERS'] = (
'pipeline.compilers.coffee.CoffeeScriptCompiler',
)

``PIPELINE_COFFEE_SCRIPT_BINARY``
``COFFEE_SCRIPT_BINARY``
---------------------------------

Command line to execute for coffee program.
You will most likely change this to the location of coffee on your system.

Defaults to ``'/usr/bin/env coffee'``.

``PIPELINE_COFFEE_SCRIPT_ARGUMENTS``
``COFFEE_SCRIPT_ARGUMENTS``
------------------------------------

Additional arguments to use when coffee is called.
Expand All @@ -38,21 +38,21 @@ Live Script compiler
The LiveScript compiler uses `LiveScript <https://github.com/gkz/LiveScript>`_
to compile your javascript.

To use it add this to your ``PIPELINE_COMPILERS`` ::
To use it add this to your ``PIPELINE['COMPILERS']`` ::

PIPELINE_COMPILERS = (
PIPELINE['COMPILERS'] = (
'pipeline.compilers.livescript.LiveScriptCompiler',
)

``PIPELINE_LIVE_SCRIPT_BINARY``
``LIVE_SCRIPT_BINARY``
---------------------------------

Command line to execute for LiveScript program.
You will most likely change this to the location of lsc on your system.

Defaults to ``'/usr/bin/env lsc'``.

``PIPELINE_LIVE_SCRIPT_ARGUMENTS``
``LIVE_SCRIPT_ARGUMENTS``
------------------------------------

Additional arguments to use when lsc is called.
Expand All @@ -65,21 +65,21 @@ LESS compiler
The LESS compiler uses `LESS <http://lesscss.org/>`_
to compile your stylesheets.

To use it add this to your ``PIPELINE_COMPILERS`` ::
To use it add this to your ``PIPELINE['COMPILERS']`` ::

PIPELINE_COMPILERS = (
PIPELINE['COMPILERS'] = (
'pipeline.compilers.less.LessCompiler',
)

``PIPELINE_LESS_BINARY``
``LESS_BINARY``
------------------------

Command line to execute for lessc program.
You will most likely change this to the location of lessc on your system.

Defaults to ``'/usr/bin/env lessc'``.

``PIPELINE_LESS_ARGUMENTS``
``LESS_ARGUMENTS``
---------------------------

Additional arguments to use when lessc is called.
Expand All @@ -92,22 +92,22 @@ SASS compiler
The SASS compiler uses `SASS <http://sass-lang.com/>`_
to compile your stylesheets.

To use it add this to your ``PIPELINE_COMPILERS`` ::
To use it add this to your ``PIPELINE['COMPILERS']`` ::

PIPELINE_COMPILERS = (
PIPELINE['COMPILERS'] = (
'pipeline.compilers.sass.SASSCompiler',
)


``PIPELINE_SASS_BINARY``
``SASS_BINARY``
------------------------

Command line to execute for sass program.
You will most likely change this to the location of sass on your system.

Defaults to ``'/usr/bin/env sass'``.

``PIPELINE_SASS_ARGUMENTS``
``SASS_ARGUMENTS``
---------------------------

Additional arguments to use when sass is called.
Expand All @@ -121,22 +121,22 @@ Stylus compiler
The Stylus compiler uses `Stylus <http://learnboost.github.com/stylus/>`_
to compile your stylesheets.

To use it add this to your ``PIPELINE_COMPILERS`` ::
To use it add this to your ``PIPELINE['COMPILERS']`` ::

PIPELINE_COMPILERS = (
PIPELINE['COMPILERS'] = (
'pipeline.compilers.stylus.StylusCompiler',
)


``PIPELINE_STYLUS_BINARY``
``STYLUS_BINARY``
--------------------------

Command line to execute for stylus program.
You will most likely change this to the location of stylus on your system.

Defaults to ``'/usr/bin/env stylus'``.

``PIPELINE_STYLUS_ARGUMENTS``
``STYLUS_ARGUMENTS``
-----------------------------

Additional arguments to use when stylus is called.
Expand All @@ -150,22 +150,22 @@ ES6 compiler
The ES6 compiler uses `Babel <https://babeljs.io>`_
to convert ES6+ code into vanilla ES5.

To use it add this to your ``PIPELINE_COMPILERS`` ::
To use it add this to your ``PIPELINE['COMPILERS']`` ::

PIPELINE_COMPILERS = (
PIPELINE['COMPILERS'] = (
'pipeline.compilers.es6.ES6Compiler',
)


``PIPELINE_BABEL_BINARY``
``BABEL_BINARY``
--------------------------

Command line to execute for babel program.
You will most likely change this to the location of babel on your system.

Defaults to ``'/usr/bin/env babel'``.

``PIPELINE_BABEL_ARGUMENTS``
``BABEL_ARGUMENTS``
-----------------------------

Additional arguments to use when babel is called.
Expand All @@ -182,7 +182,7 @@ of compilers.
To do so, you just have to create a class that inherits from ``pipeline.compilers.CompilerBase``
and implements ``match_file`` and ``compile_file`` when needed.

Finally, specify it in the tuple of compilers ``PIPELINE_COMPILERS`` in the settings.
Finally, specify it in the tuple of compilers ``PIPELINE['COMPILERS']`` in the settings.

Example
-------
Expand Down
53 changes: 27 additions & 26 deletions docs/compressors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Yuglify compressor
The Yuglify compressor uses `yuglify <http://github.com/yui/yuglify>`_
for compressing javascript and stylesheets.

To use it for your stylesheets add this to your ``PIPELINE_CSS_COMPRESSOR`` ::
To use it for your stylesheets add this to your ``PIPELINE['CSS_COMPRESSOR']`` ::

PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'
PIPELINE['CSS_COMPRESSOR'] = 'pipeline.compressors.yuglify.YuglifyCompressor'

To use it for your javascripts add this to your ``PIPELINE_JS_COMPRESSOR`` ::
To use it for your javascripts add this to your ``PIPELINE['JS_COMPRESSOR']`` ::

PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.yuglify.YuglifyCompressor'


``PIPELINE_YUGLIFY_BINARY``
Expand Down Expand Up @@ -49,13 +49,13 @@ YUI Compressor compressor
The YUI compressor uses `yui-compressor <http://developer.yahoo.com/yui/compressor/>`_
for compressing javascript and stylesheets.

To use it for your stylesheets add this to your ``PIPELINE_CSS_COMPRESSOR`` ::
To use it for your stylesheets add this to your ``PIPELINE['CSS_COMPRESSOR']`` ::

PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
PIPELINE['CSS_COMPRESSOR'] = 'pipeline.compressors.yui.YUICompressor'

To use it for your javascripts add this to your ``PIPELINE_JS_COMPRESSOR`` ::
To use it for your javascripts add this to your ``PIPELINE['JS_COMPRESSOR']`` ::

PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.yui.YUICompressor'


``PIPELINE_YUI_BINARY``
Expand Down Expand Up @@ -91,9 +91,9 @@ Closure Compiler compressor
The Closure compressor uses `Google Closure Compiler <http://code.google.com/closure/compiler/>`_
to compress javascripts.

To use it add this to your ``PIPELINE_JS_COMPRESSOR`` ::
To use it add this to your ``PIPELINE['JS_COMPRESSOR']`` ::

PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.closure.ClosureCompressor'
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.closure.ClosureCompressor'


``PIPELINE_CLOSURE_BINARY``
Expand Down Expand Up @@ -122,9 +122,9 @@ UglifyJS compressor
The UglifyJS compressor uses `UglifyJS <https://github.com/mishoo/UglifyJS2/>`_ to
compress javascripts.

To use it add this to your ``PIPELINE_JS_COMPRESSOR`` ::
To use it add this to your ``PIPELINE['JS_COMPRESSOR']`` ::

PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.uglifyjs.UglifyJSCompressor'
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.uglifyjs.UglifyJSCompressor'


``PIPELINE_UGLIFYJS_BINARY``
Expand All @@ -149,9 +149,9 @@ JSMin compressor
The jsmin compressor uses Douglas Crockford jsmin tool to
compress javascripts.

To use it add this to your ``PIPELINE_JS_COMPRESSOR`` ::
To use it add this to your ``PIPELINE['JS_COMPRESSOR']`` ::

PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.jsmin.JSMinCompressor'
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.jsmin.JSMinCompressor'

Install the jsmin library with your favorite Python package manager ::

Expand All @@ -164,9 +164,9 @@ SlimIt compressor
The slimit compressor uses `SlimIt <http://slimit.org/>`_ to
compress javascripts.

To use it add this to your ``PIPELINE_JS_COMPRESSOR`` ::
To use it add this to your ``PIPELINE['JS_COMPRESSOR']`` ::

PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.slimit.SlimItCompressor'
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.slimit.SlimItCompressor'

Install the slimit library with your favorite Python package manager ::

Expand All @@ -179,9 +179,9 @@ CSSTidy compressor
The CSStidy compressor uses `CSStidy <http://csstidy.sourceforge.net/>`_ to compress
stylesheets.

To us it for your stylesheets add this to your ``PIPELINE_CSS_COMPRESSOR`` ::
To us it for your stylesheets add this to your ``PIPELINE['CSS_COMPRESSOR']`` ::

PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.csstidy.CSSTidyCompressor'
PIPELINE['CSS_COMPRESSOR'] = 'pipeline.compressors.csstidy.CSSTidyCompressor'

``PIPELINE_CSSTIDY_BINARY``
---------------------------
Expand All @@ -202,9 +202,9 @@ CSSMin compressor
=================

The cssmin compressor uses the `cssmin <https://github.com/jbleuzen/node-cssmin>`_
command to compress stylesheets. To use it, add this to your ``PIPELINE_CSS_COMPRESSOR`` ::
command to compress stylesheets. To use it, add this to your ``PIPELINE['CSS_COMPRESSOR']`` ::

PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.cssmin.CSSMinCompressor'
PIPELINE['CSS_COMPRESSOR'] = 'pipeline.compressors.cssmin.CSSMinCompressor'

``PIPELINE_CSSMIN_BINARY``
---------------------------
Expand All @@ -229,8 +229,8 @@ This is useful for debugging faulty concatenation due to poorly written javascri

To use it, add this to your settings ::

PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.NoopCompressor'
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.NoopCompressor'
PIPELINE['CSS_COMPRESSOR'] = 'pipeline.compressors.NoopCompressor'
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.NoopCompressor'


Write your own compressor class
Expand All @@ -242,8 +242,8 @@ of compressors.
To do so, you just have to create a class that inherits from ``pipeline.compressors.CompressorBase``
and implements ``compress_css`` and/or a ``compress_js`` when needed.

Finally, add it to ``PIPELINE_CSS_COMPRESSOR`` or
``PIPELINE_JS_COMPRESSOR`` settings (see :doc:`configuration` for more information).
Finally, add it to ``PIPELINE['CSS_COMPRESSOR']`` or
``PIPELINE['JS_COMPRESSOR']`` settings (see :doc:`configuration` for more information).

Example
-------
Expand All @@ -262,5 +262,6 @@ A custom compressor for an imaginary compressor called jam ::

Add it to your settings ::

PIPELINE_CSS_COMPRESSOR = 'jam.compressors.JamCompressor'
PIPELINE_JS_COMPRESSOR = 'jam.compressors.JamCompressor'
PIPELINE['CSS_COMPRESSOR'] = 'jam.compressors.JamCompressor'
PIPELINE['JS_COMPRESSOR'] = 'jam.compressors.JamCompressor'

Loading

0 comments on commit 5aa0173

Please sign in to comment.