Md2site是基于Omi的一款Markdown转网站工具,使用简单,生成的文件轻巧,功能强大。
当咱们想把一堆markdown文档转成网站时,你可能有许多选择,假若选择 md2site ,你必定会爱上她。html
$ npm install md2site -g
安装完以后就可使用md2site 命令了。git
$ md2site init your_project_name
好比我建立一个omi的文档:github
这个时间比较长,由于还会安装相关的npm依赖包。安装成功能够看到:web
$ cd your_project_name
转到对应的项目目录。npm
找到your_project_name目录下的docs目录:markdown
在里面写你的markdown文档。在config.js中配置对应的目录树:工具
let config = { menus: { cn: [ { active: true, title: '快速开始', currentIndex: 0, list: [ {name: '安装', md: 'installation'}, {name: '组件', md: 'components'}, {name: '组件通信', md: 'communication'} ] } ], en: [ { active: true, title: 'QUICK START', currentIndex: 0, list: [ {name: 'Installation', md: 'installation'}, {name: 'Components', md: 'components'}, {name: 'Communication', md: 'communication'} ] } ] } } export default config;
写的过程当中能够经过下面的命令能够进行网站预览布局
$ npm run dev
也可发布部署:网站
$ npm run dist
一款漂亮的多语言响应式无刷新的精明文档网站就这么搞定了!简单吧~~code
若是你想让代码块中的某些行高亮,好比这个样子:
你可使用这种语法来标记须要高亮的行:
上面表明:1到3行以及26行高亮。