Add gulp example.

This commit is contained in:
David Anson 2015-03-13 22:38:44 -07:00
parent 9917d7f2fb
commit f252f4f498
2 changed files with 22 additions and 1 deletions

21
example/gulpfile.js Normal file
View file

@ -0,0 +1,21 @@
"use strict";
var gulp = require("gulp");
var through2 = require("through2");
var markdownlint = require("../lib/markdownlint");
// Simple task wrapper
gulp.task("markdownlint", function task() {
return gulp.src("*.md", { "read": false })
.pipe(through2.obj(function obj(file, enc, next) {
markdownlint(
{ "files": [ file.relative ] },
function callback(err, result) {
var resultString = (result || "").toString();
if (resultString) {
console.log(resultString);
}
next(err, file);
});
}));
});

View file

@ -18,7 +18,7 @@
"test-cover": "istanbul cover node_modules/nodeunit/bin/nodeunit",
"debug": "node debug node_modules/nodeunit/bin/nodeunit",
"lint": "eslint lib test & eslint --rule \"no-console: 0\" example",
"example": "cd example & node standalone.js"
"example": "cd example & node standalone.js & gulp markdownlint"
},
"dependencies": {
"markdown-it": "^3.0.7"