Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peduarte/mdhtmljson
Convert Markdown to HTML into a JSON file
https://github.com/peduarte/mdhtmljson
Last synced: 30 days ago
JSON representation
Convert Markdown to HTML into a JSON file
- Host: GitHub
- URL: https://github.com/peduarte/mdhtmljson
- Owner: peduarte
- Created: 2015-08-17T18:11:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-10T14:26:18.000Z (about 9 years ago)
- Last Synced: 2024-09-17T08:35:11.215Z (about 2 months ago)
- Language: JavaScript
- Size: 180 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**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.
### Installation
```
npm install mdhtmljson -g
```### CLI
```
Usage: mdhtmljson [options]Options:
-h, --help output usage information
-V, --version output the version number
-o, --output 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
```#### Example
```
mdhtmljson http://urlto.markdown.md -o /path/to/output.json
```
The command above will output the following in **/path/to/**:
**output.json**
```json
{
"html": "Contents from the markdown
...
"
}
```### NodeJS
```js
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.## Demo
You can see in action on [wallop site](https://github.com/peduarte/wallop-site) to take the Readme file from [wallop](https://github.com/peduarte/wallop) and use it as documentation on the site too. This way I only have one point of documentation 😁## Licensing
MIT © 2015 [Pedro Duarte](http://pedroduarte.me)