Skip to content

Instantly share code, notes, and snippets.

@mikehostetler
Created September 12, 2012 00:21
Show Gist options
  • Save mikehostetler/3703233 to your computer and use it in GitHub Desktop.
Save mikehostetler/3703233 to your computer and use it in GitHub Desktop.
var sass = require('node-sass');
var sassCompilerFactory = function( _, anvil ) {
var compile = _.compose( marked, showdown );
return anvil.plugin( {
name: "anvil.sass",
configure: function( config, command, done ) {
anvil.addCompiler( ".sass", this );
anvil.addCompiler( ".scss", this );
done();
},
compile: function( content, done ) {
try {
sass.render( content, function(err, css) {
done( css);
});
} catch ( error ) {
done( "", error );
}
},
rename: function( name ) {
return name.replace( ".sass", ".css" );
}
} );
};
module.exports = markdownCompilerFactory;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment