makedocs
自动创建文档工具
Install
npm install -g makedocs
usage
cd your_project_dirmakedoc build [file]
config file
必须在需要编译的文件夹内存在一个指定或者默认的配置文件。默认的文件名为makedoc.js
。
options
files
指定合并文件列表template
文档模板文件地址output
文档输出地址
template maker
我们创建自定义模板,使用的是ejs
模板引擎。
render
{function} arguments:html
子模板HTMLid
当前类IDtext
当前类名称
html
模板编译的HTML代码
<%- render(function(html, id, text){return '' + text + '' + html + '';})%><%-html%>
注意 render方法的具体使用。