mdhtmljson is a simple Node module that takes a URL of a Markdown file, converts it to HTML and outputs it into a JSON file.
npm install mdhtmljson -g
Usage: mdhtmljson <entry file> [options]
Options:
-h, --help output usage information
-V, --version output the version number
-o, --output <output file> write output to this file – include path (.json file extension not needed)
Example:
$ mdhtmljson https://github.com/peduarte/wallop/blob/master/README.md -o ./data/docs.json
mdhtmljson http://urlto.markdown.md -o /path/to/output.json
The command above will output the following in /path/to/: output.json
{
"html": "<h1>Contents from the markdown</h1><p>...</p>"
}
var mdhtmljson = require('mdhtmljson');
var markdownUrl = 'http://urlto.markdown.md';
var jsonOutput = '/path/to/output.json';
mdhtmljson(markdownUrl, jsonOutput);
#protip If not option is specified, it will output mdhtml.hson in your root directory.
You can see in action on wallop site to take the Readme file from wallop and use it as documentation on the site too. This way I only have one point of documentation 😁
MIT © 2015 Pedro Duarte