Skip to content

Instantly share code, notes, and snippets.

@sentientwaffle
Created February 5, 2012 02:14
Show Gist options
  • Save sentientwaffle/1742038 to your computer and use it in GitHub Desktop.
Save sentientwaffle/1742038 to your computer and use it in GitHub Desktop.
Stylus plugin for Jekyll
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