如何用JSDoc记录CoffeeScript源代码?

如何用JSDoc记录CoffeeScript源代码?

问题描述:

我有一些用CoffeeScript编写的代码,我想使用Google Closure Compiler来优化生成的JavaScript,因此这些文件需要用JSDoc进行记录。

I have some code written in CoffeeScript and I want to optimize the generated JavaScript with the Google Closure Compiler, so these files need to be documented with JSDoc.

我的问题是,我如何文档* .coffee文件生成javascript包含工作的JSDoc的闭包编译器?

My question is, how can I document the *.coffee files to generate javascript containing working JSDoc for the closure compiler?

另一个问题:是有办法保持单个

One more question: is there a way to keep a single-line comment in *.coffee ?

我建议反对这个。 JSDocing所有的代码是一个费力的过程,可能会从Closure编译器很少或没有受益。在Google本身之外,几乎没有人这样做。 CoffeeScripters / JavaScripters通常喜欢轻量级文档工具,如 docco

I'd advise against this. JSDoc-ing all of your code is a laborious process that's likely to yield little to no benefit from the Closure Compiler. Outside of Google itself, hardly anyone does this. CoffeeScripters/JavaScripters generally prefer lightweight documentation tools like docco.

此外,虽然Closure Compiler拥有Google品牌名称,但 UglifyJS 已证明是在许多情况下更有效的缩小工具。 (jQuery 最近切换)。

Also, while Closure Compiler has the Google brand name behind it, UglifyJS has proven to be the more efficient minification tool in many cases. (jQuery recently switched to it.)

还有一个问题:是否可以在* .coffee中保留单行注释?

One more question: is there a way to keep a single-line comment in *.coffee ?

是:

### foo ###

`// foo`