Add jsdoc plugin that maps @todo tags to @stability and @observable tags.
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.
This commit is contained in:
28
apidoc/plugins/todo.js
Normal file
28
apidoc/plugins/todo.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var util = require('util');
|
||||
exports.defineTags = function(dictionary) {
|
||||
dictionary.defineTag('todo', {
|
||||
mustHaveValue: true,
|
||||
canHaveType: true,
|
||||
canHaveName: true,
|
||||
onTagged: function(doclet, tag) {
|
||||
var parts = tag.text.split(' ');
|
||||
if (parts[0] === 'stability') {
|
||||
doclet.stability = parts.slice(1).join(' ');
|
||||
} else if (parts[0] === 'observable') {
|
||||
if (!doclet.observables) {
|
||||
doclet.observables = [];
|
||||
}
|
||||
var readonly = parts.length > 3 && parts[3] === 'readonly';
|
||||
var description = (readonly ? parts.slice(4) : parts.slice(3)).join(' ');
|
||||
doclet.observables.push({
|
||||
name: parts[2],
|
||||
type: {
|
||||
names: tag.value.type.names
|
||||
},
|
||||
description: description,
|
||||
readonly: readonly
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user