files.forEach(filePath => { const content = fs.readFileSync(filePath, "utf-8"); const AST = remark.parse(content); const codes = select(AST, `inlineCode`); codes.forEach(code => { strings.push(code.value); }); });
function parse (md) { return processor.parse(md, { position: false }).children }
remark() .use(generator, { sections, modules }) .use(toc, { maxDepth: 2, tight: true }) .use(collapse, { test: 'Table of Contents', summary: () => 'Click to expand' }) .use(github) .use(bookmarks, { modules }) // Disable padding to lessen diff noise .use(stringify, { paddedTable: false, looseTable: true }) .process(vfile.readSync(fp), (err, file) => { if (err) throw err console.error(report(file)) vfile.writeSync(file) })