5
我想添加一個customTag到jsdoc。我創建這樣的插件目錄中的文件:如何在jsdoc上添加和使用標籤?
method.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上。
我想:
self.find('methodHttp')[0]
data.methodHttp[0]
data.methodHttp
但它不工作。我的代碼有什麼問題?