按它自己的说法,这是一个马马虎虎的,冗长的,文学化编程风格的文档生成器。

使用Markdown来解析注释,用Pygments来进行代码高亮。

支持CoffeeScript, JavaScript, Ruby, Python, 和 TeX 文档。

只支持单行注释。

基于Node.js,不过有若干其他语言的实现:Ruby, Python, POSIX shell, Clojure, Lua(这个版本是单语支持的) 和 .Net。嗯,适口性不错。

生成结果就是其官网的模样,看起来还行。

使用方式自然是命令行:

docco src/*.coffee

所以它会根据后缀自行处理,相比之下YUIDoc必须使用--syntaxtype来设置CoffeeScript,还没缩写……略显坑爹啊……

可以带参数:

-h, --help             output usage information
-V, --version          output the version number
-c, --css [file]       use a custom css file
-o, --output [path]    use a custom output path
-t, --template [file]  use a custom .jst template

不过其他的实现带的参数未必一样,比如Pyhon版目前只有这些:

-h, --help                        show this help message and exit
-p, --paths                       Preserve path structure of original files
-d OUTDIR, --directory=OUTDIR     The output directory that the rendered files should go to.
-w, --watch                       Watch original files and re-generate documentation on changes

最后,作者用推荐CoffeeDoc写API文档。效果也蛮漂亮。另外,这货还能生成Github的wiki页,感觉更加有趣了。



blog comments powered by Disqus

Published

07 January 2013

Tags