5

customTag を jsdoc に追加しようとしています。次のように plugins ディレクトリにファイルを作成しました。

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

しかし、うまくいきません。コードの何が問題になっていますか?

4

1 に答える 1

4

jsDoc.defineTag大文字のタグをサポートしていません...

彼らの辞書のバグのようですが!

于 2013-02-26T17:08:12.373 に答える