Created
February 5, 2012 02:14
-
-
Save sentientwaffle/1742038 to your computer and use it in GitHub Desktop.
Stylus plugin for Jekyll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'shellwords' | |
module Jekyll | |
class StylusConverter < Converter | |
safe true | |
def matches(ext) | |
ext =~ /\.styl/i | |
end | |
def output_ext(ext) | |
'.css' | |
end | |
def convert(content) | |
begin | |
command = Shellwords.escape content | |
`echo #{command} | stylus --use nib` | |
rescue => e | |
puts "Stylus Exception: #{e.message}" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment