Name Last Update
bin Loading commit data...
init Loading commit data...
lib Loading commit data...
md Loading commit data...
src Loading commit data...
themes Loading commit data...
index.js Loading commit data...
package.json Loading commit data...
readme.md Loading commit data...
server.js Loading commit data...

转换markdown为html内容

安装

git clone git@gitlab.kmlab.com:lintry/markdown-view.git
npm install

目录

├── bin   可执行命令
├── lib   本地模块
├── md    存放markdown文件,对应服务器的"/md/"
└── themes    存放css的主题,对应服务器的"/"

功能

指定markdown文件生成html文件

var mdview = require('./lib/mdviewer')();
var path = require('path');
var result = mdview.renderFile(path.resolve(process.cwd(), 'readme.md'));

####命令行生成html内容

bin/mdview readme.md readme.html


  Usage: mdview [options] [command]


  Options:

    -V, --version  output the version number
    -h, --help     output usage information


  Commands:

    export|e [markdown_file] <html_file>  export markdown to html, default to the same path of markdown_file

启动服务

npm start

打开首页查看readme.md的显示效果👇

可选择的主题