Javascript 如何使用JSDoc记录函数
JSDoc似乎不了解我的大多数函数。下面是一个例子:Javascript 如何使用JSDoc记录函数,javascript,documentation,standards,documentation-generation,jsdoc,Javascript,Documentation,Standards,Documentation Generation,Jsdoc,JSDoc似乎不了解我的大多数函数。下面是一个例子: /** * Function one. */ (function one() { /** * Function two. */ function two() { /** * Function three. */ function three() { } } })(); var four = { /**
/**
* Function one.
*/
(function one() {
/**
* Function two.
*/
function two() {
/**
* Function three.
*/
function three() {
}
}
})();
var four = {
/**
* Function five/six.
*/
five: function six() {
},
/**
* Function seven/eight.
*/
seven: function eight() {
},
};
nine.ten = {
/**
* Function eleven/twelve.
*/
eleven: function twelve() {
/**
* Function thirteen/fourteen.
*/
var thirteen = function fourteen() {
};
},
/**
* Function fifteen/sixteen.
*/
fifteen: function sixteen() {
},
};
/**
* Function eighteen
*/
seventeen(function eighteen() {
});
/**
* Function twenty.
*/
nineteen(function twenty() {
/**
* Function twentyTwo.
*/
twentyOne(function twentyTwo() {
});
});
/**
* Function twentyThree.
*/
function twentyThree() {
}
JSDoc只接受函数二十三。其余的都完全错过了
我做错了什么?这是一个示例,可以从JSDoc(3)中获得更多输出:
这是一个示例,它将为您提供来自JSDoc(3)的更多输出:
我以前从未使用过JSDoc,但通过查看他们的文档,我不确定为什么您的任何东西都能工作。我认为你需要回去阅读JSDoc的文档。例如,我认为
four
应该被记录为@名称空间
(同样适用于您的IIFE)。我认为您需要在特定的位置使用@name
和@lends
,我以前从未使用过JSDoc,但是通过查看他们的文档,我不确定为什么您的任何东西都可以工作。我认为你需要回去阅读JSDoc的文档。例如,我认为four
应该被记录为@名称空间
(同样适用于您的IIFE)。我认为你需要在特定的地方使用@name
和@lends
/**
* Function one.
* @namespace one
*/
(function one() {
/**
* Function two.
* @namespace two
* @memberof one
*/
function two() {
/**
* Function three.
* @memberof one.two
*/
function three() {
}
}
})();