AndrewFrank0zxy 2011-02-12
代码如下:
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 as private, underscored and inner symbols. -q or --quiet Do not output any messages, not even warnings.
代码如下:
/**
* @fileOverview 简单的方法标注示例
* @author <a href="llying.javaeye.com">llying</a>
* @version 0.1
*/
/**
* @description 加法运算
* @param {Num} num1 加数
* @param {Num} num2 被加数
* @return {Num} result 结果
*/
function add(num1,num2){
return num1 + num2;
}
/**
* @description 减法运算
* @param {Num} num1 减数
* @param {Num} num2 被减数
* @return {Num} result 结果
*/
function minus(num1,num2){
return num1 - num2;
} 代码如下:
/**
* @fileOverview 简单的类对象标注示例
* @author <a href="llying.javaeye.com">llying</a>
* @version 0.1
*/
/**
* @author llying
* @constructor Person
* @description 一个Person类
* @see The <a href="#">llying</a >.
* @example new Parent(“张三”,15);
* @since version 0.1
* @param {String} username 姓名
* @param {Num} age 年龄
*/
function Person(username,age)
{
/**
* @description {Sting} 姓名
* @field
*/
this.username = username;
/**
* @description {Num} 年龄
* @field
*/
this.age = age
/**
* @description 弹出say内容
* @param {String} content 内容
*/
this.say = function(content)
{
alert(this.username+" say :"+content);
}
/**
* @description 返回json格式的对象
* @return {String} json格式
* @see Person#say
*/
this.getJson = function(){
return "{name:"+this.username+",age"+this.age+"}";
}
} 