转换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的显示效果👇
可选择的主题
- github-markdown (修改于: https://github.com/sindresorhus/github-markdown-css)
- clearness (以下皆来源于:https://github.com/rhiokim/markdown-css)
- clearness-dark
- github
- github-rhio
- haroopad
- metro-lake (修改于metro-vibes)
- metro-vibes
- metro-vibes-dark
- node-dark
- solarized-dark
- solarized-light
- wood
- wood-ri