Upgrade JSDoc to 3.3.2 and remove obsoleted plugins

This commit is contained in:
Björn Harrtell
2015-08-04 22:04:15 +02:00
parent 0ec70256d6
commit 6812de6a77
4 changed files with 1 additions and 137 deletions

View File

@@ -17,8 +17,6 @@
}, },
"plugins": [ "plugins": [
"node_modules/jsdoc/plugins/markdown", "node_modules/jsdoc/plugins/markdown",
"config/jsdoc/api/plugins/inheritdoc",
"config/jsdoc/api/plugins/interface",
"config/jsdoc/api/plugins/typedefs", "config/jsdoc/api/plugins/typedefs",
"config/jsdoc/api/plugins/events", "config/jsdoc/api/plugins/events",
"config/jsdoc/api/plugins/observable", "config/jsdoc/api/plugins/observable",

View File

@@ -1,109 +0,0 @@
/*
* This is a hack to prevent inheritDoc tags from entirely removing
* documentation of the method that inherits the documentation.
*
* TODO: Remove this hack when https://github.com/jsdoc3/jsdoc/issues/53
* is addressed.
*/
exports.defineTags = function(dictionary) {
dictionary.defineTag('inheritDoc', {
mustHaveValue: false,
canHaveType: false,
canHaveName: false,
onTagged: function(doclet, tag) {
doclet.inheritdoc = true;
}
});
};
var lookup = {};
var incompleteByClass = {};
var keepKeys = ['comment', 'meta', 'name', 'memberof', 'longname', 'augment',
'stability'];
exports.handlers = {
newDoclet: function(e) {
var doclet = e.doclet;
var incompletes;
if (!(doclet.longname in lookup)) {
lookup[doclet.longname] = [];
}
lookup[doclet.longname].push(doclet);
if (doclet.inheritdoc) {
if (!(doclet.memberof in incompleteByClass)) {
incompleteByClass[doclet.memberof] = [];
}
incompletes = incompleteByClass[doclet.memberof];
if (incompletes.indexOf(doclet.name) == -1) {
incompletes.push(doclet.name);
}
}
},
parseComplete: function(e) {
var ancestors, candidate, candidates, doclet, i, j, k, l, key;
var incompleteDoclet, stability, incomplete, incompletes;
var doclets = e.doclets;
for (i = doclets.length - 1; i >= 0; --i) {
doclet = doclets[i];
if (doclet.augments) {
ancestors = [].concat(doclet.augments);
}
incompletes = incompleteByClass[doclet.longname];
if (ancestors && incompletes) {
// collect ancestors from the whole hierarchy
for (j = 0; j < ancestors.length; ++j) {
candidates = lookup[ancestors[j]];
if (candidates) {
for (k = candidates.length - 1; k >= 0; --k) {
candidate = candidates[k];
if (candidate.augments) {
ancestors = ancestors.concat(candidate.augments);
}
}
}
}
// walk through all inheritDoc members
for (j = incompletes.length - 1; j >= 0; --j) {
incomplete = incompletes[j];
candidates = lookup[doclet.longname + '#' + incomplete];
if (candidates) {
// get the incomplete doclet that needs to be augmented
for (k = candidates.length - 1; k >= 0; --k) {
incompleteDoclet = candidates[k];
if (incompleteDoclet.inheritdoc) {
break;
}
}
}
// find the documented ancestor
for (k = ancestors.length - 1; k >= 0; --k) {
candidates = lookup[ancestors[k] + '#' + incomplete];
if (candidates) {
for (l = candidates.length - 1; l >= 0; --l) {
candidate = candidates[l];
if (candidate && !candidate.inheritdoc) {
stability = candidate.stability || incompleteDoclet.stability;
if (stability) {
incompleteDoclet.stability = stability;
for (key in candidate) {
if (candidate.hasOwnProperty(key) &&
keepKeys.indexOf(key) == -1) {
incompleteDoclet[key] = candidate[key];
}
}
}
}
}
}
}
}
}
}
}
};

View File

@@ -1,25 +0,0 @@
exports.defineTags = function(dictionary) {
var classTag = dictionary.lookUp('class');
dictionary.defineTag('interface', {
mustHaveValue: false,
onTagged: function(doclet, tag) {
classTag.onTagged.apply(this, arguments);
doclet.interface = true;
}
});
var augmentsTag = dictionary.lookUp('augments');
dictionary.defineTag('implements', {
mustHaveValue: true,
onTagged: function(doclet, tag) {
tag.value = tag.value.match(/^\{?([^\}]*)\}?$/)[1];
augmentsTag.onTagged.apply(this, arguments);
if (!doclet.implements) {
doclet.implements = [];
}
doclet.implements.push(tag.value);
}
});
};

View File

@@ -32,7 +32,7 @@
"glob": "5.0.3", "glob": "5.0.3",
"graceful-fs": "3.0.2", "graceful-fs": "3.0.2",
"handlebars": "3.0.1", "handlebars": "3.0.1",
"jsdoc": "3.3.0-alpha9", "jsdoc": "3.3.2",
"marked": "0.3.3", "marked": "0.3.3",
"metalsmith": "1.6.0", "metalsmith": "1.6.0",
"metalsmith-templates": "0.7.0", "metalsmith-templates": "0.7.0",