Add radar file walker

This commit is contained in:
Tom Raithel
2017-01-21 21:08:17 +01:00
parent a120849d56
commit 7e5395e9b1
12 changed files with 262 additions and 23 deletions

View File

@@ -9,27 +9,44 @@ import {
srcPath,
distPath,
} from './file';
import {
getTree,
createRadar,
} from './radar';
const fileName = srcPath('v1/tools/grunt.md');
console.log('<<< start creating files');
waterfall([
(callback) => {
readFile(fileName, 'utf8', callback);
},
(data, callback) => {
const item = frontmatter(data);
const html = marked(item.body);
outputFile(distPath('test3.html'), html, callback);
}
],
(err, results) => {
if (!err) {
console.log('done creating files >>>');
} else {
console.error(err);
}
(async () => {
try {
const tree = await getTree();
// console.log(JSON.stringify(tree, null, 2));
const radar = await createRadar(tree);
console.log(JSON.stringify(radar, null, 2));
} catch(e) {
console.error('error:', e);
}
);
})()
//
// const fileName = srcPath('v1/tools/grunt.md');
//
// console.log('<<< start creating files');
//
// waterfall([
// (callback) => {
// readFile(fileName, 'utf8', callback);
// },
// (data, callback) => {
// const item = frontmatter(data);
// const html = marked(item.body);
//
// outputFile(distPath('test3.html'), html, callback);
// }
// ],
// (err, results) => {
// if (!err) {
// console.log('done creating files >>>');
// } else {
// console.error(err);
// }
// }
// );