Add capabilities to document events
This commit is contained in:
18
apidoc/plugins/event.js
Normal file
18
apidoc/plugins/event.js
Normal 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(' ')
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -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(' ')
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user