concat multiple md files together and convert it to a standalone html file
using npm as a devDependency
npm install --save-dev md-html-tool
or using yarn as a devDependency
yarn add --dev md-html-tool
-
add setting to your package.json
"md-html-tool": [ "mdfiles": [ // all your markdown files' paths // beware the orders of all md files ], "target": "" // the converted html file path ]
-
write code like this
const mdhtml = require('md-html-tool'); (async () => { await mdhtml.convert(); console.log(`completed`); })();
func | description |
---|---|
convert | concat all md files and convert them to one html file |
getconf | get all configuration from package.json |
Converter will insert TOC (Table of Content) at the position that you put <!-- toc --> ... <!-- tocstop -->
<!-- toc -->
toc will be inserted here
<!-- tocstop -->
if there is no <!-- toc --> <!-- tocstop --> , no TOC will be inserted