A tool that parses and executes JavaScript from Markdown, akin to Literate CoffeeScript. Check out the annotated source or the docs below.
npm install -g eruditeUsage: erudite [options] /path/to/filename
-h, --help show this help text
-o, --outfile write to the given file path
-e, --stage ECMAScript proposal stage (0-4)
--stdout write to stdout (ignores -o)
erudite exports a single function which parses and executes a given buffer of
Markdown text:
var fs = require('fs');
var erudite = require('erudite');
var filename = './literate-javascript.md';
var text = fs.readFileSync(filename, 'utf8');
erudite(text, {
filename: filename
});You can also parse and execute separately:
var source = erudite.parse(buf);
erudite.exec(source, opts);textA string of Markdown text to processoptsA configuration objecteol(Optional) The string to use to concatenate code blocks (defaults toos.EOL)
srcA string of JavaScript source codeoptsA configuration objectfilename(Optional) The name of the source file (defaults toerudite)
MIT