我正在尝试向jsdoc添加自定义标签。我已经在插件目录中创建了一个文件,内容如下:
method.js
然后我在我的 conf.json 中添加了以下内容:
现在我尝试将这个放到我的模板上。我在 method.tmpl 上。
我尝试了:
但它不起作用。我的代码有什么问题?
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 上。
我尝试了:
self.find('methodHttp')[0]
data.methodHttp[0]
data.methodHttp
但它不起作用。我的代码有什么问题?