background preloader

JS Documentation

Facebook Twitter

Jsdoctk-plugin - A JsDoc Toolkit plugin for Maven. Jsdoctk-plugin aims simply to create a Mojo around JsDoc Toolkit so that you can run it from within maven. Inside the plugins' jar is a packaged version of JsDoc Toolkit which gets temporarily unpacked into your target directory and is then used to run JsDoc Toolkit on your webapp directory. As a result you can now, easily and without a hassle, create documentation for your javascripts within a maven project... A new version based on the JsDoc Toolkit 2.3.2 is finally released. I've not done a lot of polishing, just upgraded it to the latest toolkit release and introduced a feature which was requested by two users, in slightly different ways. For those not familiar with the changes in 2.x of JsDoc Toolkit I would give you an advance warning, the templates have changed significantly and this may, or may not be to your liking. Alternatively, even though this keeps me from being able to track the popularity of this project, you can now specify a repository in your pom.xml like so:

Jsdoc3/jsdoc. Annotating JavaScript for the Closure Compiler - Closure Tools. Overview The Closure Compiler can use data type information about JavaScript variables to provide enhanced optimization and warnings. JavaScript, however, has no way to declare types. Because JavaScript has no syntax for declaring the type of a variable, you must use comments in the code to specify the data type. The Closure Compiler's type language derives from the annotations used by the JSDoc document-generation tool. Table of Contents The Closure Compiler looks for type information in JSDoc tags. This table includes only tags that affect on the behavior of the Closure Compiler.

Type Expressions You can specify the data type of any variable, property, expression or function parameter with a type expression. Use a type expression with the @param tag to declare the type of a function parameter. The more types you specify in your code, the more optimizations the compiler can make and the more mistakes it can catch. The compiler uses these annotations to type-check your program. Generic Types. Jsdoc-toolkit - A documentation generator for JavaScript. JSDoc. History[edit] JSDoc's syntax and semantics are similar to those of the Javadoc scheme, which is used for documenting code written in Java.

JSDoc differs from Javadoc, in that it is specialized to handle JavaScript's dynamic behaviour. JSDoc tags[edit] Some of the more popular annotation tags used in modern JSDoc are: Example[edit] /** * Creates an instance of Circle. * * @constructor * @this {Circle} * @param {number} r The desired radius of the circle. JSDoc in use[edit] Google's Closure Linter and Closure Compiler [1]. See also[edit] Comparison of documentation generators References[edit] External links[edit] Official JSDoc Website, for tutorials and docs on usageOfficial JSDoc Github, for up-to-date code"Annotating JavaScript for the Closure Compiler", Closure Tools documentation, Google Developer website.