Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to generate Javascript API documentation like the Google Closure Library API Documentation?

I'm trying to find a tool that generates HTML documentation for my Javascript source code.

Does anyone know if the tool that Google uses to generate the interface at the following URLs is open source? Would I be able to generate similar output?

http://closure-library.googlecode.com/svn/docs/class_goog_proto2_Serializer.html

http://closure-library.googlecode.com/svn/docs/namespace_goog_date.html

http://closure-library.googlecode.com/svn/docs/namespace_goog_events.html

http://closure-library.googlecode.com/svn/docs/class_goog_gears_Database.html

http://closure-library.googlecode.com/svn/docs/class_goog_ui_DatePicker.html

I'm aware of http://code.google.com/p/jsdoc-toolkit/

But I'd like to know if the specific generator that Google uses is available for me to use for my own source (which is going to be open source, if that matters).

Thanks in advance...

like image 704
Homer6 Avatar asked Sep 29 '10 05:09

Homer6


People also ask

Why use Closure Library?

If you are developing a large or growing application, you may benefit from the Closure Library's breadth. A well-tested library can insulate you from cross-browser compatibility issues and the minutiae of client-side programming, letting you focus on the fun stuff.

What is closure Google what is closure in JavaScript?

What is the Closure Compiler? The Closure Compiler is a tool for making JavaScript download and run faster. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left.

What is GOOG JavaScript?

The Google Closure library is a powerful JavaScript framework and includes features which are also interesting outside of a browser environment, e.g. implementations of common algorithms (encryption, geometry, time and date handling, ...), data structures (tries, pools, priority queues, ...) and support for functional ...


1 Answers

Google Closure + JSDoc

As you mentioned yourself in your comment, they build on JSDoc Toolkit to add special annotations used by the Closure Compiler for type-checking and other things, but this means you can also just use JSDoc on top of closure code to generate your documentation. Generating an output with the desired look and feel is then only a matter of writing your own template and stylesheet.

The Google Closure Tools are all open source except for some bits that aren't disclosed at the moment. In any case, you can have a look at the documentation and source code and see what they use to generate Javadocs.

ExtJS + Ext-Doc

Another one you could possibly have a look at for inspiration and to see how they do it is the online doc for ExtJS. I find it a bit confusing to navigate at first, but you get used to it fairly quickly. An open source project, Ext-Doc, generates documentation with a similar style, though it is now a bit outdated.

YUI Doc

As mentioned by Matthew Manela, YUI Doc produces pretty good online documentation as well.

My advice would be to go for JSDoc as it is the de-facto standard for many tools and it reflects Java practices, but it's really up to what you want.

like image 175
haylem Avatar answered Sep 20 '22 15:09

haylem