如何在JSDOC中的“组”中显示Javascript方法? [英] How to display Javascript methods in a 'group' in JSDOC?

查看:224
本文介绍了如何在JSDOC中的“组”中显示Javascript方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在一个类(AMD / RequireJS模块)中分组功能?我的类有时超过20多个函数实际上属于特定的接口实现,有时它们只需要进行分组以提高可读性。



我检查了可用的jsDoc标签,但似乎没有提供这个,在Doxygen中有多少标签......



任何想法?

解决方案

这是一种方法,你的模块形状可能非常,但这适用于类和模块:

  / ** 
* @module foobar
*
* @memberof module:foobar
* @param {string} arg一个参数
** /
函数一(arg){
console.log(arg)
}
module.exports = {
one:one
}

关键是使用@memberof,


Is there are possibility to 'group' functions within a class (AMD/RequireJS Module) ? My classes have sometimes over 20+ functions which actually belong to a specific 'interface implementation' and sometimes they just need to be grouped for better readability.

I checked the available jsDoc tags but none of them seem to provide this, in Doxygen there are number of tags...

Any ideas?

解决方案

this is one way to do it, your module shape may very, but this works with classes and modules:

/**
* @module foobar
*
* @memberof module:foobar
* @param {string} arg an argument
**/
function one (arg) {
    console.log(arg)
}
module.exports = {
    one: one
}

the key is to use @memberof, documented here.

you can use it with @class documentation, or @module documentation, so it can work with any variety of ES5, ES6, or TypeScript Class or Module shapes, so long as you document the container object (class or module) with @class or @module.

result:

这篇关于如何在JSDOC中的“组”中显示Javascript方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆