将 JSDoc 与命名空间和函数定义的变体形式一起使用
我一直在尝试使用 JsDoc 来记录我的 javascript,但我不断遇到这个障碍。 它一直说“没有什么可记录的,正在退出”
这是我试图记录的代码:
/**
* Container for all editing methods
* @namespace
*/
var FREdit = {
/**
* Toggle value for editing
* @type Number
*/
isToggleOn:0,
/**
* Initialize editing
*/
init: function(){
this.initPopups();
},
/**
* Function to enable editing
*/
enable: function(){
this.enableTitles();
this.isToggleOn = 1;
}
};
上面我使用了命名空间。 即使我在 JavaScript 中使用函数定义的变体形式,JSDoc 似乎也无法识别它。 例如:
/**
* Just any function
*/
var any_function = function(){
};
知道如何解决这个问题吗? 谢谢!
I've been trying to use JsDoc for documenting my javascript but I keep coming across this hurdle. It keeps saying "nothing to document, exiting"
Here is the peice of code I'm trying to document:
/**
* Container for all editing methods
* @namespace
*/
var FREdit = {
/**
* Toggle value for editing
* @type Number
*/
isToggleOn:0,
/**
* Initialize editing
*/
init: function(){
this.initPopups();
},
/**
* Function to enable editing
*/
enable: function(){
this.enableTitles();
this.isToggleOn = 1;
}
};
Above I'm using namespace. Even if I use a variant form of function definition in JavaScript, JSDoc doesn't seem to recognise it. Eg:
/**
* Just any function
*/
var any_function = function(){
};
Any idea how to get around this? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从你的问题来看,我猜你正在使用 JSDoc。
原来的 JSDoc 已经有一段时间不受支持了。
我建议您使用 jsdoc-toolkit 作为它有更好的支持。
根据他们的文档,您可以 记录类模式。
看看他们的例子,你应该就可以开始了!
干杯!
Judging from your question I'm guessing you're using JSDoc.
The original JSDoc has been unsupported for a while now.
I suggest you use jsdoc-toolkit as it has much better support.
According to their documentation you can document the class pattern.
Take a look at their examples and you should be good to go!
Cheers!