From a1d9491d62b8cf889f8f994b765513001ddb0447 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Thu, 27 Mar 2014 01:18:59 +0100 Subject: [PATCH 1/4] Do not delete event and fires doclets --- apidoc/plugins/exports.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apidoc/plugins/exports.js b/apidoc/plugins/exports.js index 6f268734bf..9ea83120d1 100644 --- a/apidoc/plugins/exports.js +++ b/apidoc/plugins/exports.js @@ -114,7 +114,7 @@ exports.handlers = { parseComplete: function(e) { for (var j = e.doclets.length - 1; j >= 0; --j) { var doclet = e.doclets[j]; - if (doclet.kind == 'namespace') { + if (doclet.kind == 'namespace' || doclet.kind == 'event' || doclet.fires) { continue; } var fqn = doclet.longname; From 15b0bc719ef89b5f848cf3d89a205907aa1a0ca5 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Thu, 27 Mar 2014 01:56:31 +0100 Subject: [PATCH 2/4] Do not loop through parents Now that we use the parseComplete event, we walk through all doclets in the loop anyway. --- apidoc/plugins/exports.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/apidoc/plugins/exports.js b/apidoc/plugins/exports.js index 9ea83120d1..564cd3771d 100644 --- a/apidoc/plugins/exports.js +++ b/apidoc/plugins/exports.js @@ -120,19 +120,7 @@ exports.handlers = { var fqn = doclet.longname; if (fqn) { doclet.unexported = (unexported.indexOf(fqn) !== -1); - var undocumented = (api.indexOf(fqn) === -1 && !doclet.unexported); - // Remove parents that are not part of the API - var parent; - var parents = doclet.augments; - if (parents) { - for (var i = parents.length - 1; i >= 0; --i) { - parent = parents[i]; - if (api.indexOf(parent) === -1 && unexported.indexOf(parent) === -1) { - parents.splice(i, 1); - } - } - } - if (undocumented) { + if (api.indexOf(fqn) === -1 && !doclet.unexported) { e.doclets.splice(j, 1); } } From a5d8f463ff317937c40df8f323f2557ff0e6c92c Mon Sep 17 00:00:00 2001 From: ahocevar Date: Thu, 27 Mar 2014 12:37:01 +0100 Subject: [PATCH 3/4] Clean up Only mark symbol as unexported when it is not in the API, and no longer extract links from fires annotations because all links are handled now. --- apidoc/plugins/exports.js | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/apidoc/plugins/exports.js b/apidoc/plugins/exports.js index 564cd3771d..73f6dae2ed 100644 --- a/apidoc/plugins/exports.js +++ b/apidoc/plugins/exports.js @@ -37,7 +37,6 @@ function collectOliExports(source) { for (; i < ii; ++i) { property = 'ol.' + oli[i].match(/oli.([^;]*)/)[1] .replace('.prototype.', '#'); - api.push(property); unexported.push(property); } } @@ -73,7 +72,6 @@ exports.handlers = { } } if (api.indexOf(e.doclet.longname) > -1) { - // Add params, links and events of API symbols to the API var names, name; var params = e.doclet.params; if (params) { @@ -92,19 +90,9 @@ exports.handlers = { var links = e.doclet.comment.match(/\{@link ([^\}]*)\}/g); if (links) { for (i=0, ii=links.length; i < ii; ++i) { - if (unexported.indexOf(links[i]) === -1) { - unexported.push(links[i].match(/\{@link (.*)\}/)[1]); - } - } - } - var fires = e.doclet.fires; - var event; - if (fires) { - for (i = 0, ii = fires.length; i < ii; ++i) { - event = fires[i].split(' ').pop(); - name = event.replace('event:', ''); - if (unexported.indexOf(name) === -1) { - unexported.push(name); + var link = links[i].match(/\{@link (.*)\}/)[1]; + if (unexported.indexOf(link) === -1) { + unexported.push(link); } } } @@ -119,8 +107,8 @@ exports.handlers = { } var fqn = doclet.longname; if (fqn) { - doclet.unexported = (unexported.indexOf(fqn) !== -1); - if (api.indexOf(fqn) === -1 && !doclet.unexported) { + doclet.unexported = (api.indexOf(fqn) === -1 && unexported.indexOf(fqn) !== -1); + if (api.indexOf(fqn) === -1 && unexported.indexOf(fqn) === -1) { e.doclets.splice(j, 1); } } From d4eb5dd2ee552eb1a20dc7dbdd0060ef65a6a33a Mon Sep 17 00:00:00 2001 From: ahocevar Date: Thu, 27 Mar 2014 13:00:08 +0100 Subject: [PATCH 4/4] Use a more visually appealing margin for descriptions --- apidoc/template/static/styles/jsdoc-default.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apidoc/template/static/styles/jsdoc-default.css b/apidoc/template/static/styles/jsdoc-default.css index 56bbb5b4e4..4b6945c4b9 100644 --- a/apidoc/template/static/styles/jsdoc-default.css +++ b/apidoc/template/static/styles/jsdoc-default.css @@ -211,7 +211,7 @@ dt.tag-source, dd.tag-source { .description { margin-bottom: 1em; - margin-left: -16px; + margin-left: 0px; margin-top: 1em; }