2015-12-27 21:01:19 +00:00
|
|
|
var mdast = require('mdast')
|
2015-12-27 21:04:44 +00:00
|
|
|
var lint = require('mdast-lint')
|
2015-12-27 21:01:19 +00:00
|
|
|
var fs = require('graceful-fs')
|
|
|
|
var remarkTitle = require('remark-title')
|
2015-12-27 21:04:44 +00:00
|
|
|
var doc = './README.md'
|
2015-12-27 21:01:19 +00:00
|
|
|
// TODO Replace README with readme option
|
|
|
|
|
|
|
|
fs.writeFileSync(doc, mdast().use(remarkTitle, {
|
|
|
|
title: 'IPFS Readme Standard'
|
2015-12-27 21:04:44 +00:00
|
|
|
}, lint).process(
|
2015-12-27 21:01:19 +00:00
|
|
|
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!')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
)
|