Gulp snowcrash to create documentation with API Blueprint
This libary is gulp-snowcrash with updated dependencies by nicgordon and an updated name to make it more easily findable.
Usage only for generating the JSON representation.
var protagonist = require('gulp-protagonist');
gulp.task('docs', function () {
return gulp.src('./blueprint/**/*.md')
.pipe(protagonist({ format: 'json' }))
.pipe(gulp.dest('./_blueprint'));
});
Usage if you want to combine this with something like Blueman.
var protagonist = require('gulp-protagonist'),
exec = require('child_process').exec;
gulp.task('docs:blueprint', function () {
return gulp.src('./blueprint/blueprint.md')
.pipe(protagonist({ format: 'json' }))
.pipe(gulp.dest('./_blueprint'));
});
gulp.task('docs:blueman', function(cb){
exec('blueman convert ./blueprint/blueprint.md --host=http://example.com/api/ --output=./blueprint/blueprint_collection.json', function (err, stdout, stderr) {
util.log(stdout);
util.log(stderr);
cb(err);
});
});
gulp.task('docs', ['docs:compile', 'docs:blueman']);