Permalink
Browse files

Stylus support

  • Loading branch information...
1 parent e8b55d9 commit 006016e2b5c7ea1811d4493877c0c94d0ca48479 myfreeweb committed Feb 3, 2011
Showing with 27 additions and 1 deletion.
  1. +8 −0 README.markdown
  2. +12 −0 hydeengine/media_processors.py
  3. +3 −0 templates/default/settings.py
  4. +4 −1 templates/default_html5/settings.py
View
@@ -160,6 +160,14 @@ You need to install Less (see [the project website][lesscss]) and set the ``LESS
[lesscss]: http://lesscss.org/
+#### Stylus Processor
+
+Runs through the all the files defined in the configuration associated with ``'hydeengine.media_processors.Stylus'`` and converts them to css.
+
+You need to install Stylus (see [the project website][stylus]) and set the ``STYLUS_PATH`` variable to the path to the ``stylus`` script.
+
+[stylus]: http://learnboost.github.com/stylus/
+
#### CSSPrefixer Processor
Runs through the all the files defined in the configuration associated with ``'hydeengine.media_processors.CSSPrefixer'`` and adds vendor prefixed versions of CSS3 rules.
@@ -90,6 +90,18 @@ def process(resource):
if not out_file.exists:
print 'Error Occurred when processing with Less'
+class Stylus:
+ @staticmethod
+ def process(resource):
+ stylus = settings.STYLUS_PATH
+ if not stylus or not os.path.exists(stylus):
+ raise ValueError("Stylus Processor cannot be found at [%s]" % stylus)
+ try:
+ check_call([stylus, resource.source_file.path])
+ except CalledProcessError, e:
+ print 'Syntax Error when calling stylus:', e
+ resource.source_file.delete()
+
class CSSPrefixer:
@staticmethod
def process(resource):
@@ -63,6 +63,9 @@
'.less':('hydeengine.media_processors.TemplateProcessor',
'hydeengine.media_processors.LessCSS',
'hydeengine.media_processors.CSSmin',),
+ '.styl':('hydeengine.media_processors.TemplateProcessor',
+ 'hydeengine.media_processors.Stylus',
+ 'hydeengine.media_processors.CSSmin',),
'.hss':(
'hydeengine.media_processors.TemplateProcessor',
'hydeengine.media_processors.HSS',
@@ -65,6 +65,9 @@
'.less': ('hydeengine.media_processors.TemplateProcessor',
'hydeengine.media_processors.LessCSS',
'hydeengine.media_processors.YUICompressor',),
+ '.styl':('hydeengine.media_processors.TemplateProcessor',
+ 'hydeengine.media_processors.Stylus',
+ 'hydeengine.media_processors.CSSmin',),
'.hss': (
'hydeengine.media_processors.TemplateProcessor',
'hydeengine.media_processors.HSS',
@@ -103,7 +106,7 @@
# Processor Configuration
-#
+#
# Set this to the output of `which growlnotify`. If `which` returns
# emtpy, install growlnotify from the Extras package that comes with
# the Growl disk image.

0 comments on commit 006016e

Please sign in to comment.