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:
Paul Spencer
2013-10-26 14:43:22 -04:00
parent 1529aad7f6
commit d3b8d0b676
10 changed files with 180 additions and 1 deletions

28
apidoc/plugins/todo.js Normal file
View 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
});
}
}
});
};