aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/ngdoc.js
diff options
context:
space:
mode:
authorMatias Niemelä2013-10-16 22:48:32 -0400
committerMatias Niemelä2013-10-23 17:00:12 -0400
commita7e12b7959212f2fa88fe17d5a045cc9d8b22922 (patch)
tree3613ad9f20a92eb9e7a88402e34a078092663cba /docs/src/ngdoc.js
parent3f568b22f9bec09192588e3cae937db5c2e757f9 (diff)
downloadangular.js-a7e12b7959212f2fa88fe17d5a045cc9d8b22922.tar.bz2
feat(docs): provide index pages for each angular module
Diffstat (limited to 'docs/src/ngdoc.js')
-rw-r--r--docs/src/ngdoc.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js
index 24d1aa26..249f1802 100644
--- a/docs/src/ngdoc.js
+++ b/docs/src/ngdoc.js
@@ -213,6 +213,14 @@ Doc.prototype = {
return words.join(' ');
},
+ shortDescription : function() {
+ var text = this.description.split("\n")[0];
+ text = text.replace(/<.+?\/?>/g, '');
+ text = text.replace(/{/g,'&#123;');
+ text = text.replace(/}/g,'&#125;');
+ return text;
+ },
+
getMinerrNamespace: function () {
if (this.ngdoc !== 'error') {
throw new Error('Tried to get the minErr namespace, but @ngdoc ' +
@@ -471,11 +479,20 @@ Doc.prototype = {
(this.ngdoc === 'error' ? this.name : '') ||
(((this.file||'').match(/.*(\/|\\)([^(\/|\\)]*)\.ngdoc/)||{})[2]) || // try to extract it from file name
this.name; // default to name
+ this.moduleName = parseModuleName(this.id);
this.description = this.markdown(this.description);
this.example = this.markdown(this.example);
this['this'] = this.markdown(this['this']);
return this;
+ function parseModuleName(id) {
+ var module = id.split('.')[0];
+ if(module == 'angular') {
+ module = 'ng';
+ }
+ return module;
+ }
+
function flush() {
if (atName) {
var text = trim(atText.join('\n')), match;
@@ -1106,6 +1123,8 @@ function metadata(docs){
name: title(doc),
shortName: shortName,
type: doc.ngdoc,
+ moduleName: doc.moduleName,
+ shortDescription: doc.shortDescription(),
keywords:doc.keywords()
});
});