Automating JS API documentation with Jsdoc-toolkit

Source: Internet
Author: User

In the previous blog post discussion of automation engineering issues, NODEJS-based, gulp, grunt JSDoc plug-ins are used for document automation. This paper discusses the implementation of automation based on Java environment.

One, Java installation and environment configuration

For Java installation and environment configuration, you can refer to the blog Yui Compressor for Sublime Text2

Second, Jsdoc-tookit download and use

Download Link: Jsdoc-tookit, now the address may be wall, can be downloaded by searching other channels. When finished, unzip to the working directory.

CMD---command-line window

CD to Jsdoc-toolkit directory (mine is G:\Workspace\jsdoc-toolkit)

Windows:java-jar Jsrun.jar app\run.js-a-t=templates\jsdoc mytest/mytest.js

linux:$ Java-jar Jsrun.jar app/run.js-a-t=templates/jsdoc mytest/mytest.js

Generate out (default) directory after run

Complete the Automation API documentation.

Of course the annotations in the Mytest.js file need to conform to the JSDoc specification. If we do not want to use the default directory out, it can be set by the-D command.

Jsdoc-toolkit Related Command Reference:

G:\workspace\jsdoc-toolkit>java-jar Jsrun.jar app\run.js--helpusage:java-jar jsrun.jar app/run.js [OPTIONS] < Src_dir> <SRC_FILE> ...  OPTIONS:-A or--allfunctions Include all functions, even undocumented ones.  -C or--conf Load a configuration file.  -d=<path> or--directory=<path> Output to this directory (defaults to "out"). -d= "Myvar:my value" or--define= "Myvar:my value" multiple.  Define a variable, available in JsDoc as Jsdoc.opt.d.myvar.  -e=<encoding> or--encoding=<encoding> Use this ENCODING to read and write files. -e= "regex" or--exclude= "regex" multiple.  Exclude files based on the supplied regex.  -H or--help Show this message and exit.  -N or--nocode Ignore all code, only document comments with @name tags.  -o=<path> or--out=<path> Print log messages to a file (defaults to stdout). -P or--private Include symbols tagged asPrivate, underscored and inner symbols.  -Q or--quiet does not output any messages, not even warnings.  -r=<depth> or--recurse=<depth> descend into SRC directories.  -S or--suppress suppress source code output.  -S or--securemodules use Secure Modules mode to parse source code. -t=<path> or--template=<path> Required.  Use this template to format the output.  -T or--test Run all unit tests and exit.  -U or--unique force file names to is unique, but not based on symbol names.  -V or--verbose provide verbose feedback about what's happening.          -x=<ext>[,ext] ... or--ext=<ext>[,ext] ... Scan source files with the given EXTENSION/S (defaults to JS).


Reprint statement:

This article title: Using Jsdoc-toolkit Implementation JS API document automation

This article link: http://www.zuojj.com/archives/1064.html, reprint please specify transfer from benjamin-focus on front-end development and user experience

Automating JS API documentation with Jsdoc-toolkit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.