Commit d3fd1b2f by David Charbonnier Committed by Timothée Peignier

add stylus support

Signed-off-by: Timothée Peignier <timothee.peignier@tryphon.org>
parent 2d5329a9
......@@ -88,6 +88,36 @@ To use it add this to your ``PIPELINE_COMPILERS`` ::
Defaults to ``''``.
Stylus compiler
===============
The Stylus compiler use `Stylus <http://learnboost.github.com/stylus/>`
to compile your stylesheets.
To use it add this to your ``PIPELINE_COMPILERS`` ::
PIPELINE_COMPILERS = (
'pipeline.compilers.stylus.StylusCompiler',
)
``PIPELINE_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/local/bin/stylus'``.
``PIPELINE_STYLUS_ARGUMENTS``
-----------------------------
Additional arguments to use when stylus is called.
Defaults to ``''``.
Write your own compiler class
=============================
......
import os.path
from pipeline.conf import settings
from pipeline.compilers import SubProcessCompiler
class StylusCompiler(SubProcessCompiler):
output_extension = 'css'
def match_file(self, filename):
return filename.endswith('.styl')
def compile_file(self, content, path):
command = "%s %s" % (
settings.PIPELINE_STYLUS_BINARY,
settings.PIPELINE_STYLUS_ARGUMENTS,
)
cwd = os.path.dirname(path)
return self.execute_command(command, content, cwd=cwd)
......@@ -54,6 +54,9 @@ PIPELINE_COFFEE_SCRIPT_ARGUMENTS = getattr(settings, 'PIPELINE_COFFEE_SCRIPT_ARG
PIPELINE_SASS_BINARY = getattr(settings, 'PIPELINE_SASS_BINARY', '/usr/local/bin/sass')
PIPELINE_SASS_ARGUMENTS = getattr(settings, 'PIPELINE_SASS_ARGUMENTS', '')
PIPELINE_STYLUS_BINARY = getattr(settings, 'PIPELINE_STYLUS_BINARY', '/usr/local/bin/stylus')
PIPELINE_STYLUS_ARGUMENTS = getattr(settings, 'PIPELINE_STYLUS_ARGUMENTS', '')
PIPELINE_LESS_BINARY = getattr(settings, 'PIPELINE_LESS_BINARY', '/usr/local/bin/lessc')
PIPELINE_LESS_ARGUMENTS = getattr(settings, 'PIPELINE_LESS_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