开发者

Javadoc on CoffeeScript?

开发者 https://www.devze.com 2023-03-02 16:48 出处:网络
I\'m new to CoffeeScript and seems that I can\'t find any document generator for CoffeeScript using Javadoc syntax. The only one I could find is available as a patch to the CoffeeScript compiler.

I'm new to CoffeeScript and seems that I can't find any document generator for CoffeeScript using Javadoc syntax. The only one I could find is available as a patch to the CoffeeScript compiler.

So, what do you use to generate document开发者_开发问答ation from Javadoc comment on CoffeeScript or how do you document your function arguments and return values?


So, JavaDoc syntax has never really caught on with JavaScript developers. There are those who use something like it—notably Google—but it's kind of at odds with JS, which doesn't have static typing and allows any number of arguments to any function.

If you want to create beautiful documentation with CoffeeScript, the standard is Docco (its home page is an excellent example). If you want to create JavaDoc-style comments for every function... well, you'll have to create them by hand, and escape them with backticks.

Alternatively, you could work in CoffeeScript until your code is release-ready, then document the resulting JavaScript.


Docco is great for prozedural coding style. If you want to document an API, coffeedoc is for you.


People looking forward to using javadoc style documentation in coffeescript can checkout codo ( http://netzpirat.github.com/codo/ ) which provides support for a subset of javadoc and automatically infers class names, function names and parameters from source code.


I'm using YUIDoc. I can add comments using a syntax similar to Javadoc to my classes, methods and events. The documentation gets output as html/css files and you can even customize the page layout.

Check this documentation example: http://yui.github.com/yuidoc/api/

PS: It relies on Node.JS and you need to install the package yuidocjs

npm install yuidocjs -g
0

精彩评论

暂无评论...
验证码 换一张
取 消