Socket
Book a DemoInstallSign in
Socket

mdhtmljson

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdhtmljson

Convert Markdown to HTML into a JSON file

latest
Source
npmnpm
Version
1.1.5
Version published
Weekly downloads
22
2100%
Maintainers
1
Weekly downloads
 
Created
Source

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 <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

Example

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>"
}

NodeJS

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 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 😁

Licensing

MIT © 2015 Pedro Duarte

FAQs

Package last updated on 26 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts