From 95d3c754ee1cb0064f96c40bb469d8813a750600 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Sun, 27 Dec 2015 16:01:19 -0500 Subject: [PATCH] Attempted to make a plugin Cannot seem to get it working automatically yet --- index.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..aa0e303 --- /dev/null +++ b/index.js @@ -0,0 +1,23 @@ +var mdast = require('mdast') +// var lint = require('mdast-lint') +var fs = require('graceful-fs') +var remarkTitle = require('remark-title') +var doc = '/Users/richard/src/ipfs-readme-standard/README.md' +// TODO Replace README with readme option + +fs.writeFileSync(doc, mdast().use(remarkTitle, { + title: 'IPFS Readme Standard' +}).process( + fs.readFileSync(doc, 'utf8'), function (err, file, res) { + if (err) { + console.log(err) + return + } + + if (file.messages[0] != null) { + console.log(file.messages) + } else { + console.log('No errors found!') + } + }) +)