From 12e989da0863e20aa3477388e4673ab07aa0acd2 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 28 Jan 2016 10:51:54 +0000 Subject: [PATCH] chore(doc-gen): include static members in the class template Closes #761 --- .../templates/class.template.html | 22 ++++++++++++++++++- .../processors/readTypeScriptModules.js | 6 ++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/tools/api-builder/angular.io-package/templates/class.template.html b/tools/api-builder/angular.io-package/templates/class.template.html index 2c516b7ce6..1ae71026de 100644 --- a/tools/api-builder/angular.io-package/templates/class.template.html +++ b/tools/api-builder/angular.io-package/templates/class.template.html @@ -53,9 +53,29 @@ p.location-badge. {% endif -%} {% endif %} +{% if doc.statics.length -%} +.l-main-section + h2 Static Members +{%- for member in doc.statics %}{% if not member.internal %} + .l-sub-section + h3#{$ member.name | toId $} + pre.prettyprint + code. + {$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + + :marked + {%- if member.notYetDocumented %} + *Not Yet Documented* + {% else %} +{$ member.description | indentForMarkdown(6) | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} + {% endif %} +{% endif %}{% endfor %} +{%- endif -%} + + {% if doc.members.length -%} .l-main-section - h2 Members + h2 Instance Members {%- for member in doc.members %}{% if not member.internal %} .l-sub-section h3#{$ member.name | toId $} diff --git a/tools/api-builder/typescript-package/processors/readTypeScriptModules.js b/tools/api-builder/typescript-package/processors/readTypeScriptModules.js index 3739b7b337..910b28d2dd 100644 --- a/tools/api-builder/typescript-package/processors/readTypeScriptModules.js +++ b/tools/api-builder/typescript-package/processors/readTypeScriptModules.js @@ -132,8 +132,12 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, if (a.name < b.name) return -1; return 0; }); + exportDoc.statics.sort(function(a, b) { + if (a.name > b.name) return 1; + if (a.name < b.name) return -1; + return 0; + }); } - }); }); }