JsDoc Toolkit

Brief introduction

JsDoc Toolkit is an auxiliary tool, you only need to add the appropriate comments in the JavaScript code in accordance with the agreement, it can be automatically generated API documentation based on these comments. Java familiar to people who may find it a document automation tool and Java JavaDoc like, yes, JsDoc Toolkit is based on JavaDoc development.

download link

http://code.google.com/p/jsdoc-toolkit/

Directory Structure

  • app: js file is stored. Some examples include js file js file and read the document and template generation.
  • conf: file provides default configuration.
  • java: is stored in "rhino" This is a script written in javascript java script engine, to provide js operating environment.
  • templates: a template stored document generation, can generate html xml and other types of documents based on a different template.
  • jsrun.jar, jsdebug.jar: the entrance to generate calls rhino framework and js files

Operating mode

(The framework provides a runtime environment javascript), and then run the javascript read javascript files and template files to generate documentation generation framework document calls rhino through a period of java code (jsrun.jar).

Comment tags

Tag here is the comment tags agreement, only wrote these labels, JsDoc Toolkit in order to generate the correct documentation according to these labels, such as with a small section of the code sample after @example.

Available tags list: http://code.google.com/p/jsdoc-toolkit/wiki/TagReference

use

First, switch to the current directory, windows execute the following command

> java -jar jsrun.jar app\run.js -a -t=templates\jsdoc mycode.js

Mac OS or Linux command execution west

$ java -jar jsrun.jar app/run.js -a -t=templates/jsdoc mycode.js

If successful, you will see more than the current folder out of the file folder called out, produced a document on the inside! Then you can view in your browser.

Description:

  • "Java -jar jsrun.jar app / run.js": Fixed code must contain each run.
  • -a or -allfunctions: generate documentation for all functions, including those who do not write comments.
  • -c or -conf: using a configuration file
  • -d = or -directory =: Specifies the document generation output directory, the default is "out"
  • or -e = -encoding =: Specifies encoding
  • -n or -nocode: it ignores all of the code, only to generate annotated document @name tag.
  • -o = or -out =: the output log information to the specified file
  • -q or -quiet: does not output any information, including warning.
  • -t = or -template =: template, this parameter specifies the documents must be provided

View Help

$ java -jar jsrun.jar app/run.js --help
	

Rhino

Mozilla's Rhino JavaScript runtime engine's official website:. Http://www.mozilla.org/rhino/ , the meaning of the word rhinoceros.

Reference article

Reproduced in: https: //www.cnblogs.com/rainman/archive/2011/08/14/2137934.html

Guess you like

Origin blog.csdn.net/weixin_33825683/article/details/93561288