Created
August 31, 2017 21:09
-
-
Save jrolfs/d10612665fcdd4bda28acf1a332fee13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tree = markdown.parse(fs.readFileSync('README.md', 'utf8')); | |
const taskOptions = lodash.chain(tree) | |
.transform((memo, node) => { | |
if (memo.section && memo.list) { | |
} else if (node[0] === 'header' && node[1].level === 2 && node[2].match(/Making/)) { | |
memo.section = true; | |
} else if (node[0] === 'header' && node[1].level === 5 && node[2].match(/Options/)) { | |
memo.list = true; | |
} | |
return memo; | |
}, { nodes: [], section: false, list: false }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment