3

こんにちは私はJSDoc-toolkitにカスタムタグを追加しようとしています。私が見つけた唯一の有用なサイトはこれでした:カスタムタグを使用していますが、機能しません。

私も{+data.comment.getTag("customTag")[0]+}運が悪かっただけで試しました。

4

1 に答える 1

5

これを @TODO タグに使用して動作します。次に例を示します。

/**
 * Working with cookies (set/get/delete)

 * @namespace Cookies related methods
 * @TODO serialize javascript object and store in cookie
 */
x.cookie = x.cookie || {};

/**
 * Set cookie with name/value and expiration with one year
 * 
 * @param {string} name
 * @param {string} value
 * @TODO write this method 
 */
x.cookie.set    = function(name, value) {

};

次のように、デフォルト テンプレートに最初の @TODO を追加できます。

<!-- ============================== ToDo summary ======================== -->
            {!
                var todos = data.comment.getTag("TODO");
            !}
            <if test="todos.length">
                <table class="summaryTable" cellspacing="0" summary="A summary of the TODOs documented in the class {+data.alias+}.">
                    <caption>TODO Summary</caption>
                    <thead>
                        <tr>
                            <th scope="col"></th>
                            <th scope="col">ToDo Description</th>
                        </tr>
                    </thead>
                    <tbody>
                    <for each="todo" in="todos">
                        <tr>
                            <td class="attributes">

                            </td>
                            <td class="nameDescription">
                                {+todo+}
                            </td>
                        </tr>
                    </for>
                    </tbody>
                </table>                
            </if>

2 つ目は、メソッドごとに次のとおりです。

<if test="member.comment.getTag('TODO')[0]">
    todo: {+ member.comment.getTag("TODO")[0] +} 
</if>
于 2011-03-12T13:22:46.890 に答える