diff --git a/apidoc/conf.json b/apidoc/conf.json index 8131a4bc6e..42c9f657d7 100644 --- a/apidoc/conf.json +++ b/apidoc/conf.json @@ -21,6 +21,7 @@ "apidoc/plugins/inheritdoc", "apidoc/plugins/exports", "apidoc/plugins/todo", + "apidoc/plugins/event", "apidoc/plugins/observable", "apidoc/plugins/stability" ], diff --git a/apidoc/plugins/event.js b/apidoc/plugins/event.js new file mode 100644 index 0000000000..f1375f9a41 --- /dev/null +++ b/apidoc/plugins/event.js @@ -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(' ') + }); + } + }); +}; diff --git a/apidoc/plugins/todo.js b/apidoc/plugins/todo.js index 1a8a4ec65e..78faccb817 100644 --- a/apidoc/plugins/todo.js +++ b/apidoc/plugins/todo.js @@ -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(' ') + }); } } }); diff --git a/apidoc/template/tmpl/container.tmpl b/apidoc/template/tmpl/container.tmpl index b10f51a72a..3a92ea4e68 100644 --- a/apidoc/template/tmpl/container.tmpl +++ b/apidoc/template/tmpl/container.tmpl @@ -101,6 +101,18 @@ + +

Events

+ +

These events are available in addition to the Observable Properties events listed above.

+ +
+ + + + + + Name + Description + + + + + + + + + + + + diff --git a/build.py b/build.py index 7962522c69..97c1b29dc4 100755 --- a/build.py +++ b/build.py @@ -373,7 +373,7 @@ virtual('lint', 'build/lint-timestamp', 'build/lint-generated-timestamp', def build_lint_src_timestamp(t): t.run('%(GJSLINT)s', '--jslint_error=all', - '--custom_jsdoc_tags=todo,function', + '--custom_jsdoc_tags=event,todo,function', '--strict', t.newer(t.dependencies)) t.touch()