feat: tie in challenge parser

This commit is contained in:
Mrugesh Mohapatra
2018-09-27 20:21:53 +05:30
parent 03abb0facc
commit eff9ce74bd
19 changed files with 1100 additions and 1099 deletions

View File

@ -0,0 +1,18 @@
const visit = require('unist-util-visit');
const YAML = require('js-yaml');
function plugin() {
return transformer;
function transformer(tree, file) {
visit(tree, 'yaml', visitor);
function visitor(node) {
const frontmatter = YAML.load(node.value);
file.data = { ...file.data, ...frontmatter };
}
}
}
module.exports = plugin;