Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javadoc on CoffeeScript?

Tags:

coffeescript

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 documentation from Javadoc comment on CoffeeScript or how do you document your function arguments and return values?

like image 933
willwill Avatar asked May 01 '11 18:05

willwill


3 Answers

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.

like image 177
Trevor Burnham Avatar answered Nov 14 '22 08:11

Trevor Burnham


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

like image 35
gossi Avatar answered Nov 14 '22 10:11

gossi


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.

like image 7
lorefnon Avatar answered Nov 14 '22 09:11

lorefnon