1

是否可以忽略 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 中排除标签?

4

1 回答 1

1

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

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

  1. (可选)fork 现有的YUIDoc 项目
  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列表进行更改。

于 2013-10-27T06:54:41.690 回答