Created
February 20, 2014 14:08
-
-
Save ukabu/9114366 to your computer and use it in GitHub Desktop.
Graphviz dot to png using Gulp
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
var gulp = require('gulp') | |
var spawn = require('gulp-spawn') | |
gulp.task('dot', function() { | |
return gulp.src('*.dot') | |
.pipe(spawn({ | |
cmd: 'dot' | |
, args: ['-Tpng'] | |
, filename: function(base, ext) { | |
return base+'.png' | |
} | |
})) | |
.pipe(gulp.dest('.')) | |
}) | |
gulp.task('watch', function() { | |
gulp.watch('*.dot', ['dot']) | |
}) | |
gulp.task('default', ['dot']) |
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
{ | |
"name": "dot-graphs", | |
"version": "0.0.0", | |
"description": "Dot Graphs to PNG", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"repository": "", | |
"author": "Ukabu", | |
"license": "ISC", | |
"devDependencies": { | |
"gulp": "^3.5.2", | |
"gulp-spawn": "^0.2.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment