Fork me on GitHub

YUIDoc - Javascript Documentation Tool

Jump to Table of Contents

Welcome to YUIDoc 0.3.45!

YUIDoc is a Node.js application that generates API documentation from comments in source, using a syntax similar to tools like Javadoc and Doxygen. YUIDoc provides:

  • Live previews. YUIDoc includes a standalone doc server, making it trivial to preview your docs as you write.
  • Modern markup. YUIDoc's generated documentation is an attractive, functional web application with real URLs and graceful fallbacks for spiders and other agents that can't run JavaScript.
  • Wide language support. YUIDoc was originally designed for the YUI project, but it is not tied to any particular library or programming language. You can use it with any language that supports /* */ comment blocks.

Installation and Usage

  1. Download and install Node.js
  2. Run npm -g install yuidocjs.
  3. Run yuidoc . at the top of your JS source tree.

That's it! For more information about running the yuidoc commandline tool, refer to "Using YUIDoc".

User Guides

Example YUIDoc Comment Blocks

YUIDoc parses a modified form of JSDoc tags. This section provides a taste of some of the more common constructs in YUIDoc. For more information, refer to the "YUIDoc Syntax Reference".

Example Class Block

/**
* This is the description for my class.
*
* @class MyClass
* @constructor
*/

Example Method Block

/**
* My method description.  Like other pieces of your comment blocks, 
* this can span multiple lines.
*
* @method methodName
* @param {String} foo Argument 1
* @param {Object} config A config object
* @param {String} config.name The name on the config object
* @param {Function} config.callback A callback function on the config object
* @param {Boolean} [extra=false] Do extra, optional work
* @return {Boolean} Returns true on success
*/

Example Property Block

/**
* My property description.  Like other pieces of your comment blocks, 
* this can span multiple lines.
* 
* @property propertyName
* @type {Object}
* @default "foo"
*/