dav*_*ave 10 javascript documentation documentation-generation jsdoc
我正在努力使用jsdoc-toolkit以下面的格式记录代码.在我看来,我使用的标签应该产生所需的结果,但事实并非如此.相反,它警告Class是未记录的(因为它只在闭包内定义)并且不包括命名空间成员列表中的Class.
如果可能的话,我想记录这个,而不是使用@name标签.有人可以帮忙吗?
/**
* @namespace The original namespace
*/
var namespace = function () {
// private
/**
* @private
*/
function _privateMethod () {
};
/**
* This is the detail about the constructor
* @class This is the detail about the class
* @param {Object} argone The first argument
* @param {Object} argtwo The second argument
*/
var Class = function (argone, argtwo) {
/**
* A public member variable
*/
this.member = "a member";
};
/**
* A public method
* @param {Object} argone The first argument
*/
Class.prototype.publicMethod = function (argone) {
};
return /** @lends namespace */ {
Class: Class
}
}();
Run Code Online (Sandbox Code Playgroud)
小智 4
我尝试了很多不同的东西,这是我能想到的最好的。
第一部分...publicMethod记录Class. 首先制作Class一个memberOf namespace,然后@lends在 上使用Class.prototype。例子:
/**
* @namespace The original namespace
*/
var namespace = function () {
// private
/**
* @private
*/
function _privateMethod () {
};
/**
* This is the detail about the constructor
* @class This is the detail about the class
* @memberOf namespace
* @param {Object} argone The first argument
* @param {Object} argtwo The second argument
*/
var Class = function (argone, argtwo) {
/**
* A public member variable
*/
this.member = "a member";
};
Class.prototype =
/** @lends namespace.Class */
{
/** a public method
* @param {Object} argone The first argument
*/
publicMethod: function (argone) {
}
};
return {
Class: Class
}
}();
Run Code Online (Sandbox Code Playgroud)
现在,第二部分...开始Class出现在namespace. 我不知道该怎么做...抱歉!它将显示namespace.Class在类别索引中。
| 归档时间: |
|
| 查看次数: |
9730 次 |
| 最近记录: |