如何用JSDoc记录CoffeeScript源代码? [英] How to document CoffeeScript source code with JSDoc?

查看:158
本文介绍了如何用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`

这篇关于如何用JSDoc记录CoffeeScript源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆