This is a temporary measure until Plovr handles custom tags or is replaced in the build system. Add support for indicating API stability with inline documentation In preparation for documenting the stability of API features, this commit adds support for indicating API stability via a new jsdoc tag @stability. There is a small plugin for jsdoc that adds a new tag, @stabiility, with some ability to enforce specific level names. The templates and css have been updated to include the stability level in the generated documentation. (+1 squashed commit) Squashed commits: [d6bc03d] Add jsdoc plugin for documenting observable properties of a class.
21 lines
724 B
JavaScript
21 lines
724 B
JavaScript
var conf = env.conf.stability;
|
|
var defaultLevels = ["deprecated","experimental","unstable","stable","frozen","locked"];
|
|
var levels = conf.levels || defaultLevels;
|
|
var util = require('util');
|
|
exports.defineTags = function(dictionary) {
|
|
dictionary.defineTag('stability', {
|
|
mustHaveValue: true,
|
|
canHaveType: false,
|
|
canHaveName: true,
|
|
onTagged: function(doclet, tag) {
|
|
var level = tag.text;
|
|
if (levels.indexOf(level) >=0) {
|
|
doclet.stability = level;
|
|
} else {
|
|
var errorText = util.format('Invalid stability level (%s) in %s line %s', tag.text, doclet.meta.filename, doclet.meta.lineno);
|
|
require('jsdoc/util/error').handle( new Error(errorText) );
|
|
}
|
|
}
|
|
})
|
|
};
|