是否可以忽略 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 没有提供设置要忽略的标签列表的方法,也没有提供任何其他方法来筛选这些警告。
但是,您可以执行以下操作:
- (可选) fork 现有 YUIDoc project
编辑
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 // ... ]
- 正常运行 YUIDoc 并观察警告消失!
请注意,这些字段不会出现在文档中,但似乎您主要关心的是如何省略警告。如果您确实想要处理标签,则需要对 DIGESTERS
列表进行更改。
关于javascript - 忽略 yuidoc javascript 文档中的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18486842/