diff options
| author | Matias Niemelä | 2013-10-16 22:48:32 -0400 | 
|---|---|---|
| committer | Matias Niemelä | 2013-10-23 17:00:12 -0400 | 
| commit | a7e12b7959212f2fa88fe17d5a045cc9d8b22922 (patch) | |
| tree | 3613ad9f20a92eb9e7a88402e34a078092663cba /docs/src/ngdoc.js | |
| parent | 3f568b22f9bec09192588e3cae937db5c2e757f9 (diff) | |
| download | angular.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.js | 19 | 
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,'{'); +    text = text.replace(/}/g,'}'); +    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()      });    }); | 
