mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Add Grunt example.
This commit is contained in:
parent
3217272971
commit
ec7684b95f
3 changed files with 69 additions and 3 deletions
26
example/Gruntfile.js
Normal file
26
example/Gruntfile.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
"use strict";
|
||||
|
||||
var markdownlint = require("../lib/markdownlint");
|
||||
|
||||
module.exports = function wrapper(grunt) {
|
||||
grunt.initConfig({
|
||||
"markdownlint": {
|
||||
"example": {
|
||||
"src": [ "*.md" ]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerMultiTask("markdownlint", function task() {
|
||||
var done = this.async();
|
||||
markdownlint(
|
||||
{ "files": this.filesSrc },
|
||||
function callback(err, result) {
|
||||
var resultString = err || ((result || "").toString());
|
||||
if (resultString) {
|
||||
grunt.fail.warn("\n" + resultString + "\n");
|
||||
}
|
||||
done(!err || !resultString);
|
||||
});
|
||||
});
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue