From f9d9847320c7ffa290b0053e3d0b109934db7a2d Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Fri, 27 May 2011 14:59:43 +0200 Subject: [PATCH] jsdoc: add methods and properties from inherited classes. --- .../jsdoc-toolkit/templates/jsdoc/class.tmpl | 51 +++++++++++++++++-- .../jsdoc-toolkit/templates/jsdoc/method.tmpl | 5 +- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/build/jsdoc-toolkit/templates/jsdoc/class.tmpl b/build/jsdoc-toolkit/templates/jsdoc/class.tmpl index 735c2078..b3bc4350 100644 --- a/build/jsdoc-toolkit/templates/jsdoc/class.tmpl +++ b/build/jsdoc-toolkit/templates/jsdoc/class.tmpl @@ -15,6 +15,31 @@ operators[name].push(operator); } } + + var inheritedProperties = data.properties.filter(function($) {return $.memberOf != data.alias}); + var inheritedMethods = data.methods.filter(function($) {return $.memberOf != data.alias}); + var inheritedClasses = {}; + var inheritedClassLinks = []; + inheritedProperties.concat(inheritedMethods).map(function($) { + if (!inheritedClasses[$.memberOf]) { + inheritedClassLinks.push(new Link().toSymbol($.memberOf)); + inheritedClasses[$.memberOf] = { + className: $.memberOf, + properties: [], + methods: [] + }; + } + }); + + for (var i = 0, l = inheritedProperties.length; i < l; i++) { + var symbol = inheritedProperties[i]; + inheritedClasses[symbol.memberOf].properties.push(symbol); + } + + for (var i = 0, l = inheritedMethods.length; i < l; i++) { + var symbol = inheritedMethods[i]; + inheritedClasses[symbol.memberOf].methods.push(symbol); + } !} @@ -31,6 +56,9 @@

{+data.alias+}

+ +

Extends {+ inheritedClassLinks.join(', ') +}

+

{+processInlineTags(data.classDesc)+}

@@ -93,10 +121,6 @@

Functions

- {! member.desc = processGroupTitle(member.desc, member) !} - -

{+member.groupTitle+}

-
{+ templates.method.process(member) +}
@@ -108,5 +132,22 @@
- + + + +

Inherited properties from {+ new Link().toSymbol(inheritedClass.className) +}

+ + {+ templates.property.process(member) +} + +
+
+ + +

Inherited functions from {+ new Link().toSymbol(inheritedClass.className) +}

+ + {+ templates.method.process(member) +} + +
+
+
\ No newline at end of file diff --git a/build/jsdoc-toolkit/templates/jsdoc/method.tmpl b/build/jsdoc-toolkit/templates/jsdoc/method.tmpl index b1417076..e013e239 100644 --- a/build/jsdoc-toolkit/templates/jsdoc/method.tmpl +++ b/build/jsdoc-toolkit/templates/jsdoc/method.tmpl @@ -1,10 +1,13 @@ {! + data.desc = processGroupTitle(data.desc, data); var memberId = Helpers.getSymbolId(data); var functionTitle = '' + data.name.replace(/\^\d+$/, '') + '' + makeSignature(data.params); if (data.isStatic) functionTitle = '' + data.memberOf + '.' + functionTitle; !} - + +

{+data.groupTitle+}

+