javascript - 忽略 yuidoc javascript 文档中的标签

标签 javascript yuidoc

是否可以忽略 yuidoc 中的各种标签以使文档构建过程消息更有用。

我对@author、@date 等标签有疑问

/**
 * The XYZ View ... 
 * These tags yuidoc result in a yuidoc warning
 * 
 * @company <company name>
 * @date Mon Aug 27 2013 22:30:50 GMT+0200 (CEST)
 * 
 * These tags yuidoc is able to interpret
 * @author Bernhard <email@foo>
 * @module Welcome    
 * @submodule Frontend
 * @class WelcomeView
 * @constructor
 *
 */

 // Yuidoc throws warnings like
 warn: (docparser): unknown tag: company, path/to/file.js:1
 warn: (docparser): unknown tag: date, path/to/file.js:1:1

而且有大量的文件使得不可能找到“真正的”警告” 有没有办法在 yuidoc 中排除标签?

最佳答案

根据我进行的研究,YUIDoc 没有提供设置要忽略的标签列表的方法,也没有提供任何其他方法来筛选这些警告。

但是,您可以执行以下操作:

  1. (可选) fork 现有 YUIDoc project
  2. 编辑yuidocjs/lib/docparser.js,并将所需的标签添加到TAGLIST:

    TAGLIST = [
        // ...
        "conditional", // conditional module
        "company",
        "config", // a config param (not an attribute, so no change events)
        // ...
        "contributor", // like author
        "date",
        "default", // property/attribute default value
        // ...
    ]
    
  3. 正常运行 YUIDoc 并观察警告消失!

请注意,这些字段不会出现在文档中,但似乎您主要关心的是如何省略警告。如果您确实想要处理标签,则需要对 DIGESTERS 列表进行更改。

关于javascript - 忽略 yuidoc javascript 文档中的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18486842/

相关文章:

javascript - 如何使用 jQuery 从输入字段获取值宽度?

javascript - 使用 Canvas 时是否可以避免 "The operation is insecure"?

yui - 如何使用离线资源构建 YUIDoc?

javascript - 如何在yuidoc中添加外部链接(grunt-contrib-yuidoc)

javascript - 在这种情况下如何转换、翻译?

javascript - ES6 模板文字 VS 连接字符串的相等性

javascript - jQuery ajax 因未知原因失败

javascript - 如何判断我的方法接受 {id : String, label : String} in yuidoc? 的数组

javascript - yuidoc - 如何在其他文件中定义类方法

javascript - Yuidoc : specify the nature of the param