Custom Doclet from Google

Doclava is custom Javadoc Doclet from Google, used by Google Guice (see their slight cooler Javadocs). Doclava uses JSilver as its templating engine, a pure-Java implementation of Clearsilver. I personally like the idea of Federated Documents to allow documentations to link and intgrate to each other on open projects. Here are the main differences between Doclava and the standard Doclet:

  • Refreshed look and feel, including search capabilities.
  • Embeds versioning information in the documentation.
  • Uses a templating engine for user customizations.
  • Throw build errors for things that can easily be caught, like @param tags that don’t match the parameter names.
  • Ability to include snippets of code from real source code
  • Federate documentation between multiple sites.
  • Ability to embed javadocs in a larger web page.

Using Doclava with Javadoc

  -doclet com.google.doclava.Doclava -docletpath ${jar.file}

Using Doclava with Ant

  ...                                                                                                        

Using Doclava with Maven

  ...             ...               org.apache.maven.plugins         maven-javadoc-plugin         2.7                               com.google.doclava             doclava             1.0.3                     com.google.doclava.Doclava                     ${sun.boot.class.path}                        -quiet              -federate JDK http://download.oracle.com/javase/6/docs/api/index.html?              -federationxml JDK http://doclava.googlecode.com/svn/static/api/openjdk-6.xml              -hdf project.name "${project.name}"              -d ${project.build.directory}/apidocs                       false                     -J-Xmx1024m                    

Improved Tags

Doclava supports a few extra tags such as @undeprecate (pretty self-explanatory), @hide (remove from the documentation), @include $filePath (includes text from file), @sample (includes sample from file) and a few different ones. Please see the complete list here.

Customization

And if you are tired of the old Javadoc look and feel, you can customize the output of Doclava. For more information click here.

[![Enhanced by Zemanta](http://img.zemanta.com/zemified_e.png?x-id=efba6a0f-8f2f-44bb-940a-61f919c94cc7)](http://www.zemanta.com/ "Enhanced by Zemanta")