Add capabilities to document events

This commit is contained in:
ahocevar
2014-03-24 21:53:18 +01:00
parent b613c9cde7
commit 50f8eb65fd
6 changed files with 61 additions and 1 deletions

18
apidoc/plugins/event.js Normal file
View File

@@ -0,0 +1,18 @@
var util = require('util');
exports.defineTags = function(dictionary) {
dictionary.defineTag('event', {
mustHaveValue: true,
canHaveType: false,
canHaveName: true,
onTagged: function(doclet, tag) {
var parts = tag.text.split(' ');
if (!doclet.events) {
doclet.events = [];
}
doclet.events.push({
name: tag.value.name,
description: parts.slice(1).join(' ')
});
}
});
};

View File

@@ -22,6 +22,14 @@ exports.defineTags = function(dictionary) {
description: description,
readonly: readonly
});
} else if (parts[0] === 'event') {
if (!doclet.events) {
doclet.events = [];
}
doclet.events.push({
name: parts[1],
description: parts.slice(2).join(' ')
});
}
}
});