[documentation.js](https://github.com/documentationjs/documentation),一款生成 JS API doc 的工具.可以说是安装使用都很方便,生成的文档也漂亮简洁.
- 安装
1 | npm install -g documentation |
- 使用
下面有一段用于测试的 JS 代码
1 | /** |
将上面的文件保存为 foo.js,然后执行下面的命令:
1 | documentation foo.js -o test -f html |
- -o:指定输出内容的文件/文件夹
- -f:指定了输出内容的格式,这里设置为
html,documentation 默认的输出格式是json,还可以输出md格式
实际预览效果如下图:

documentation.js 可玩的东西还比较多,比如扩展主题等,今天就先介绍这么多了.