Commit 0d245056 by Timothée Peignier

Merge pull request #205 from demux/master

Live Script Support
parents 893f3b65 b33fbac5
......@@ -32,6 +32,33 @@ To use it add this to your ``PIPELINE_COMPILERS`` ::
Defaults to ``''``.
Live Script compiler
======================
The LiveScript compiler uses `LiveScript <https://github.com/gkz/LiveScript>`_
to compile your javascripts.
To use it add this to your ``PIPELINE_COMPILERS`` ::
PIPELINE_COMPILERS = (
'pipeline.compilers.livescript.LiveScriptCompiler',
)
``PIPELINE_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``
------------------------------------
Additional arguments to use when lsc is called.
Defaults to ``''``.
LESS compiler
=============
......
from __future__ import unicode_literals
from pipeline.conf import settings
from pipeline.compilers import SubProcessCompiler
class LiveScriptCompiler(SubProcessCompiler):
output_extension = 'js'
def match_file(self, path):
return path.endswith('.ls')
def compile_file(self, infile, outfile, outdated=False, force=False):
if not outdated and not force:
return # File doesn't need to be recompiled
command = "%s -cp %s %s > %s" % (
settings.PIPELINE_LIVE_SCRIPT_BINARY,
settings.PIPELINE_LIVE_SCRIPT_ARGUMENTS,
infile,
outfile
)
return self.execute_command(command)
......@@ -48,6 +48,9 @@ PIPELINE_CSSMIN_ARGUMENTS = getattr(settings, 'PIPELINE_CSSMIN_ARGUMENTS', '')
PIPELINE_COFFEE_SCRIPT_BINARY = getattr(settings, 'PIPELINE_COFFEE_SCRIPT_BINARY', '/usr/bin/env coffee')
PIPELINE_COFFEE_SCRIPT_ARGUMENTS = getattr(settings, 'PIPELINE_COFFEE_SCRIPT_ARGUMENTS', '')
PIPELINE_LIVE_SCRIPT_BINARY = getattr(settings, 'PIPELINE_LIVE_SCRIPT_BINARY', '/usr/bin/env lsc')
PIPELINE_LIVE_SCRIPT_ARGUMENTS = getattr(settings, 'PIPELINE_LIVE_SCRIPT_ARGUMENTS', '')
PIPELINE_SASS_BINARY = getattr(settings, 'PIPELINE_SASS_BINARY', '/usr/bin/env sass')
PIPELINE_SASS_ARGUMENTS = getattr(settings, 'PIPELINE_SASS_ARGUMENTS', '')
......
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