Skip to content

Instantly share code, notes, and snippets.

@patrickarlt
Created November 14, 2019 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickarlt/422732942575fcdab2530491cfb3d5cb to your computer and use it in GitHub Desktop.
Save patrickarlt/422732942575fcdab2530491cfb3d5cb to your computer and use it in GitHub Desktop.
(async () => {
const inPath = "./example.mdx";
const outPath = "./example-out.mdx";
const file = await read(inPath);
const processor = remark().use(mdx);
const tree = processor.parse(file.contents.toString());
const result = processor.stringify(tree);
console.log("result", result);
await write({
path: outPath,
result
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment