JSDoc-toolkit 中的自定义标签

发布于 2024-10-16 23:29:45 字数 221 浏览 3 评论 0原文

你好 我正在尝试将自定义标签添加到 JSDoc-toolkit。我发现的唯一有用的网站是:使用自定义标签,但它不起作用。

我也尝试了 {+data.comment.getTag("customTag")[0]+} 但没有成功。

Hi
I'm trying to add custom tag to JSDoc-toolkit. Only useful site I found was this: Using custom tags but it doesn't work.

I also tried just {+data.comment.getTag("customTag")[0]+} with no luck.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

东走西顾 2024-10-23 23:29:45

我将其用于 @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>

对于每个方法,添加第二个@TODO:

<if test="member.comment.getTag('TODO')[0]">
    todo: {+ member.comment.getTag("TODO")[0] +} 
</if>

I'm using this for @TODO tag and works. Here is example:

/**
 * 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) {

};

You can add first @TODO in default template like this:

<!-- ============================== 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>

and second one, for each method:

<if test="member.comment.getTag('TODO')[0]">
    todo: {+ member.comment.getTag("TODO")[0] +} 
</if>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文