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/templates | |
| parent | 3f568b22f9bec09192588e3cae937db5c2e757f9 (diff) | |
| download | angular.js-a7e12b7959212f2fa88fe17d5a045cc9d8b22922.tar.bz2 | |
feat(docs): provide index pages for each angular module
Diffstat (limited to 'docs/src/templates')
| -rw-r--r-- | docs/src/templates/css/docs.css | 23 | ||||
| -rw-r--r-- | docs/src/templates/js/docs.js | 42 |
2 files changed, 65 insertions, 0 deletions
diff --git a/docs/src/templates/css/docs.css b/docs/src/templates/css/docs.css index 430ff4c9..783f1d21 100644 --- a/docs/src/templates/css/docs.css +++ b/docs/src/templates/css/docs.css @@ -508,3 +508,26 @@ pre ol li { font-size: 16px; word-break: normal; } + +.text-info { + color:#3a87ad; +} + +.definition-table tr > td:first-child { + font-weight:bold; + width:30%; +} + +.definition-table.spaced { + margin-bottom:30px; +} + +.component-heading { + text-transform:capitalize; +} + +.component-breakdown { + margin-bottom:30px; + padding-bottom:30px; + border-bottom:1px solid #aaa; +} diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js index fbabf193..2c5c56d2 100644 --- a/docs/src/templates/js/docs.js +++ b/docs/src/templates/js/docs.js @@ -207,6 +207,48 @@ docsApp.directive.sourceEdit = function(getEmbeddedTemplate) { } }; +docsApp.directive.docModuleComponents = ['sections', function(sections) { + return { + template: ' <div class="component-breakdown">' + + ' <h2>Module Components</h2>' + + ' <div ng-repeat="(key, section) in components">' + + ' <h3 class="component-heading" id="{{ section.type }}">{{ section.title }}</h3>' + + ' <table class="definition-table">' + + ' <tr>' + + ' <th>Name</th>' + + ' <th>Description</th>' + + ' </tr>' + + ' <tr ng-repeat="component in section.components">' + + ' <td><a ng-href="{{ component.url }}">{{ component.shortName }}</a></td>' + + ' <td>{{ component.shortDescription }}</td>' + + ' </tr>' + + ' </table>' + + ' </div>' + + ' </div>', + scope : { + module : '@docModuleComponents' + }, + controller : ['$scope', function($scope) { + var validTypes = ['property','function','directive','service','object','filter']; + var components = {}; + angular.forEach(sections.api, function(item) { + if(item.moduleName == $scope.module) { + var type = item.type; + if(type == 'object') type = 'service'; + if(validTypes.indexOf(type) >= 0) { + components[type] = components[type] || { + title : type, + type : type, + components : [] + }; + components[type].components.push(item); + } + } + }); + $scope.components = components; + }] + }; +}] docsApp.directive.docTutorialNav = function(templateMerge) { var pages = [ |
