JavaScript Documentation generator with custom tags support
JavaScript Ruby PHP
Pull request Compare This branch is 1 commit ahead, 698 commits behind senchalabs:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
js-classes
lib/jsduck
opt
spec
template
.gitignore
.travis.yml
COPYING
README.md
Rakefile
jsduck.gemspec

README.md

JSDuck

Build Status

API documentation generator for Sencha JavaScript frameworks.

JSDuck aims to be a better documentation generator for Ext JS than the old ext-doc was. It is used by Sencha to document Ext JS 4, Sencha Touch and several other products.

The highlights of JSDuck are Markdown support and keeping you DRY by inferring a lot of information from code. Read the documentation for full overview.

New to JSDuck? Watch introductory talk by Nick Poulden:

SenchaCon 2011 JSDuck talk

Getting it

Standard rubygems install should do:

$ [sudo] gem install jsduck

Windows users probably want to download a binary release.

See the installation guide for help when you run into problems.

Usage

For the simplest test-run just use the --builtin-classes option to automatically produce documentation for JavaScript builtin classes like Array, String and Object:

$ jsduck --builtin-classes --output your/docs

You can also use --verbose option to see what's actually happening.

To generate docs for Ext JS 4 add path to the corresponding src/ dir:

$ jsduck ext-4.1.1/src \
         --builtin-classes \
         --images ext-4.1.1/docs/images \
         --warnings=-no_doc,-dup_member,-link_ambiguous \
         --external XMLHttpRequest \
         --output your/docs

The --images option specifies a path for images included with {@img} tags inside the source code.

The --warnings option disables some of the warnings which you would otherwise be overwhelmed with. That's because Ext JS 4.1.1 was released when JSDuck 4 wasn't out yet. Sorry for that, JSDuck just wants to be helpful. Similarly the --external option defines XMLHttpRequest as an external class, otherwise a warning would be thrown.

Another thing that often happens is that JSDuck is unable to determine into which class a member belongs and will place all such items into a global class - you can disable this using the --ignore-global switch. For full list of all command line options type jsduck --help. For help on a specific option use --help=--some-option.

To generate docs for your own project, simply name additional input directories:

$ jsduck ext-4.1.1/src project1/js project2/js ...

Note that the resulting documentation will only contain the API documentation. Guides, videos and examples will not be present. These can be added using more command line options as explained in the documentation.

Documenting your code

Read the documentation and take a look at example.js.

Hacking it

See Hacking guide in wiki.

Who's using JSDuck?

These are some that we know of. Want your project listed here? Drop us a line.

Copying

JSDuck is distributed under the terms of the GNU General Public License version 3.

JSDuck was developed by Rene Saarsoo, with many contributions from Nick Poulden.

Thanks to Ondřej Jirman, Thomas Aylott, johnnywengluu, gevik, ligaard, Bill Hubbard, Ed Spencer, atian25, Katherine Chu, Rob Dougan, Dave Thompson, burnnat, vjetteam, Chris Westbrook, Scott Whittaker, Timo Tijhof, and many-many others who reported bugs, submitted patches, and provided a lot of useful input.

Changelog

See Changelog page in wiki.

More questions?

Feel free to post an issue, but read the FAQ first.