忽略yuidoc javascript documentor中的标签

时间:2013-08-28 11:39:24

标签: 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中排除标签?

1 个答案:

答案 0 :(得分:1)

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

但是,你可以做的如下:

  1. (可选)分叉现有的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并观察警告消失!
  4. 请注意,这些字段不会出现在文档中,但您似乎主要关心的是如何省略警告。如果您确实想要处理标记,则需要对DIGESTERS列表进行更改。

相关问题