Skip to content

Instantly share code, notes, and snippets.

@ftnext
Last active March 29, 2024 15:34
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 ftnext/350c91a32890c1b64b63fb8df2e21cf0 to your computer and use it in GitHub Desktop.
Save ftnext/350c91a32890c1b64b63fb8df2e21cf0 to your computer and use it in GitHub Desktop.
const { readFileSync, writeFileSync } = require('fs');
const { markdownToBlocks } = require('@tryfabric/martian');
// node practice.js example.md blocks.json
const markdown = readFileSync(process.argv[2], { encoding: "utf8" });
const blocks = markdownToBlocks(markdown);
writeFileSync(process.argv[3], JSON.stringify(blocks, null, 2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment