我正在尝试向 jsdoc 添加自定义标签。我在插件目录中创建了一个文件,如下所示:
方法.js
exports.defineTags = function(dictionary) {
dictionary.defineTag("methodHttp", {
mustHaveValue: true,
canHaveType: false,
canHaveName: true,
onTagged: function(doclet, tag) {
doclet.methodHttp = tag.value;
}
});
};
然后我添加到我的conf.json:
{
"tags": {
"allowUnknownTags": true
},
"source": {
"includePattern": ".+\\.js(doc)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"plugins": [ "plugins/method" ],
"templates": {
"cleverLinks": false,
"monospaceLinks": false,
"default": {
"outputSourceFiles": true
}
},
"jsVersion": 180
}
现在我尝试将其添加到我的模板中。我正在使用method.tmpl。
I tried:
self.find('methodHttp')[0]
data.methodHttp[0]
data.methodHttp
但这不起作用。我的代码有什么问题吗?