@tilecloud/mdhtml
v0.2.0
Published
[](https://travis-ci.org/tilecloud/mdhtml) [](https://badge.fury.io/js/%40tilecloud%2Fmdhtml)
Downloads
9
Readme
@tilecloud/mdhtml
This is a command line tool to convert Markdown file to HTML with template.
Usage
$ mdhtml --help
Usage: mdhtml <FILE> --template=<FILE|URL> [--output <FILE>]
Options:
-V, --version output the version number
-t, --template <FILE|URL> Path or URL of the template.
-o, --output <FILE> Path to the output.
-h, --help output usage informationHow to install
$ npm install -g @tilecloud/mdhtmlExample
Output HTML to STDOUT generated from README.md with template template.html.
$ mdhtml README.md -t template.htmlSave HTML into index.html.
$ mdhtml README.md -t template.html -o index.htmlYou can get template from remote server.
$ mdhtml README.md -t https://example.com/template.html -o index.htmlTemplate specification.
The basic template should be like following.
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title></title>
</head>
<body>
<div id="md-container">
</div>
</body>
</html>Actually, it is very simple.
- The contents generated from the markdown will be inserted into the
#md-containerelement. - The title will be generated from the first
<h1 />element.
It is using the Showdown as a markdown parser, please see documentation. https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax
