4

I want to generate a HTML-Documentation for my Javascript code. The comments in my code are written in a format, the Google Closure Compiler can use to optimize my code.

Example:

/**
 * Class for handling timing events.
 *
 * @param {number=} opt_interval Number of ms between ticks (Default: 1ms).
 * @param {Object=} opt_timerObject  An object that has setTimeout, setInterval,
 *     clearTimeout and clearInterval (eg Window).
 * @constructor
 * @extends {goog.events.EventTarget}
 */
goog.Timer = function(opt_interval, opt_timerObject) {
...
}

I am looking for something like http://yardoc.org for Javascript.

What tools can you recommend? Are there any specific tools for Google Closure code?

Julius Eckert
  • 1,481
  • 4
  • 16
  • 24

2 Answers2

1

The better is to use last version (3.2.0) https://github.com/jsdoc3/jsdoc It understands almost all Closure annotations. I'm using it for http://estejs.com documentation.

Daniel Steigerwald
  • 1,075
  • 1
  • 9
  • 19
1

That format is called "JsDoc". You can convert from JsDoc-annotated javascript to HTML using http://code.google.com/p/jsdoc-toolkit/

dplass
  • 1,463
  • 10
  • 20