mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add gulp example.
This commit is contained in:
parent
9917d7f2fb
commit
f252f4f498
2 changed files with 22 additions and 1 deletions
21
example/gulpfile.js
Normal file
21
example/gulpfile.js
Normal 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);
|
||||
});
|
||||
}));
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue