Jsdocx - 文檔自動化生成工具
這是一款用java寫的文檔生成工具。可以自動掃描JS源代碼,抽取所有類的方法與屬性生成完整的項目API文檔。
示例代碼生成的HTML文檔可以看這里:
http://jsdocx.sourceforge.net/example/sanguo/js/jsdocx/index.html
Jsdocx的項目首頁:
http://jsdocx.sourceforge.net/
Jsdocx的注釋規范文檔:
http://jsdocx.sourceforge.net/Jsdocx_Annotation_Specification.html
你可以下載jar。
在命令行中執行:
java -cp org.dragonfly.jsdocx-<version>.jar org.dragonfly.jsdocx.JsdocCreator -Souredir=<js source's directory>
Arguments:
-Charset=<charset>: the generating html document's charset
-Souredir=<directoryPath>: the javascript source's directory
-Docdir=<directoryPath>: the generating html document's directory
-Clean: clean the html document's directory before generating
或者在Java代碼中執行:
JsdocConfig config = new JsdocConfig();
config.setSourceDir("the javascript source's directory");
new JsdocCreator(config).generate();