With the popularity of Web2.0, JavaScript has become a recognized programming language, due to the emergence of a large number of JS open source framework, the use of JavaScript development projects more and more, more and more. At the same time, there are more and more JavaScript development problems exposed, such as performance, Web page loading speed, etc., in which JavaScript document maintenance has become a problem for developers to solve.
Many modern programming languages have their own integrated document generation tools, like Java with JavaDoc. NET has ndoc,php PHPDOC, these automated document tools can automatically generate code documents based on annotations in the code.
JSDoc Toolkit is an automated documentation tool that is an Open-source project posted on Google code and, like other language document tools, automatically extracts annotations from JavaScript code to generate formatted documents.
Download Address
Http://code.google.com/p/jsdoc-toolkit/downloads/list
Operating Environment
JSDoc Toolkit is developed in Java and requires Java 1.5+ at run time.
usage
Before you run, you need to switch your current working directory to the JSDoc Toolkit directory and make sure that the Java.exe directory is added to the environment variable.
Java-jar Jsrun.jar app/run.js-a-t=templates/jsdoc mycode.js
Mycode.js is the need to generate a document JS code, if Mycode.js and JSDoc are not in the same directory, please add the file's absolute or relative path. If you have more than one JS in your project, you can use the wildcard character * to specify multiple JS files (*.js). The-e parameter specifies the document encoding, the-t parameter specifies the document template location (you can create or modify template files to make the output code files more distinctive), and the resulting document files are in the Out directory in the JSDoc directory. In order to use easily, I wrote a batch file, you can save the code as Run.bat, put in the JSDoc directory::: Run.bat @echo off:: JS filename (replaced by your JS filename) set Jsname=jquery.js:: JS file path ( Switch to your JS file path) Set Jspath=c:/test/echo start ... java-jar jsrun.jar app/run.js-a-e=gbk-t=templates/jsdoc "%jspath%%jsname %.js ":: out/%jsname%/index.html Echo finished. Pause
Common Keywords
Author |
Identify code author |
Class |
Identifies the function as a constructor of a class |
constant |
Declaring constants |
Constructor |
Same class |
Default |
Default value |
Deprecated |
Declaring an object that has been deprecated |
Description |
Object description |
Event |
Event function |
Example |
Example code |
Fileoverview |
JavaScript File General description |
Ignore |
Ignore functions with this tag |
Link |
Associating with other JSDoc objects |
Name |
Display declared JSDoc objects that cannot be automatically detected |
Namespace |
declaring namespaces |
Param |
Parameters |
Private |
Declaring private objects |
Property |
Explicitly declaring a property |
Public |
Declaring a public object |
Requires |
The object or file on which the declaration depends |
Returns |
return value |
The |
Declaration of other objects that can be referenced |
Since |
Declares that the object takes effect from the specified version |
Static |
Explicitly declaring a static object |
Throws |
To declare an exception that might be thrown during execution of a function |
Type |
Declaring a variable type or function return value type |
Version |
Version number |
Detailed syntax see: JSDoc Toolkit Wiki
Finishing from: http://blog.tugai.net/2010/01/08/jsdoc-toolkit-usage/
This article is the use of B3log Solo from the simple design of the art of the synchronization of the release of the original address: http://88250.b3log.org/articles/2010/11/26/jsdoc-toolkit-usage.html