Files
freeCodeCamp/tools/challenge-parser/parser/tools/generate-ast.js
Oliver Eyton-Williams a3a678b7af chore: remove old parser
2021-02-02 09:51:02 +05:30

15 lines
403 B
JavaScript

const { read } = require('to-vfile');
const remark = require('remark');
const directive = require('remark-directive');
const frontmatter = require('remark-frontmatter');
(async () => {
const path = './example.md';
const file = await read(path);
await remark()
.use(directive)
.use(frontmatter, ['yaml'])
.use(() => tree => console.log(JSON.stringify(tree)))
.process(file);
})();