问题描述
名称路径的文档说,您应该转义特殊字符:
The documentation for namepaths says you should escape special characters:
但是,这不适用于圆点.如果我要记录一个名为"cellClick.dt"的事件,则jsDoc将从输出中跳过文档,并在目录中生成错误的链接.我尝试了以下组合:
However, this doesn't work on dots. If I have an event called "cellClick.dt" that I want to document, jsDoc skips the documentation from the output, and generates an incorrect link in the table of contents. I have tried the following combinations:
myClass~event.namespace
'myClass~event.namespace'
myClass~event\.namespace
myclass~'event.namespace'
它们全部都以某种方式生成损坏的文档.最后一个似乎至少生成正确的链接和文档,但是撇号仍在输出中.这使得在事件中使用点作为命名空间分隔符的代码的文档非常繁琐(例如,默认情况下jQuery插件执行此操作).
All of them generate broken docs in some way. The last one at least seem to generate correct links and docs, but the apostrophes are still here in the output. This makes it very cumbersome to document code that uses dots for namespace separators in events (like eg. jQuery plugins do by default).
执行此操作的正确方法是什么?有一个吗?我使用的版本是3.3.0-alpha9.
What's the correct way to do this? Is there one? The version I'm using is 3.3.0-alpha9.
推荐答案
我建议这样做:
/**
* @class
*/
function myClass () {
}
/**
* @memberof myClass
* @event event.namespace
*/
该事件已正确命名,并且是myClass
的成员.必须将全名分成两部分很烦人,但至少结果并不难看.
The event is properly named and is a member of myClass
. It's annoying to have to split off the full name in two parts but at least the result is not ugly.
这篇关于您如何在jsDoc的名称/事件/回调中包含点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!