diff options
| author | Brian Ford | 2013-11-04 11:31:27 -0800 | 
|---|---|---|
| committer | Brian Ford | 2013-11-04 11:43:41 -0800 | 
| commit | a92b419551450573a8f71c562618159af68ad8e8 (patch) | |
| tree | 646a643e01abed6ffce3da1c1cd73e7e054bd308 /docs/src | |
| parent | 8f989d652f70fd147f66a18411070c7b939e242e (diff) | |
| download | angular.js-a92b419551450573a8f71c562618159af68ad8e8.tar.bz2 | |
chore(docs): fix ordering of docs in the guide
Diffstat (limited to 'docs/src')
| -rw-r--r-- | docs/src/ngdoc.js | 58 | 
1 files changed, 55 insertions, 3 deletions
| diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index ca21a80c..396b41ad 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -1125,10 +1125,10 @@ function metadata(docs){        type: doc.ngdoc,        moduleName: doc.moduleName,        shortDescription: doc.shortDescription(), -      keywords:doc.keywords() +      keywords: doc.keywords()      });    }); -  pages.sort(keywordSort); +  pages.sort(sidebarSort);    return pages;  } @@ -1161,7 +1161,59 @@ var KEYWORD_PRIORITY = {    '.dev_guide.di': 8,    '.dev_guide.unit-testing': 9  }; -function keywordSort(a, b){ + +var GUIDE_PRIORITY = [ +  'introduction', +  'overview', +  'concepts', +  'dev_guide.mvc', + +  'dev_guide.mvc.understanding_controller', +  'dev_guide.mvc.understanding_model', +  'dev_guide.mvc.understanding_view', + +  'dev_guide.services.understanding_services', +  'dev_guide.services.managing_dependencies', +  'dev_guide.services.creating_services', +  'dev_guide.services.injecting_controllers', +  'dev_guide.services.testing_services', +  'dev_guide.services.$location', +  'dev_guide.services', + +  'dev_guide.templates.databinding', +  'dev_guide.templates.css-styling', +  'dev_guide.templates.filters.creating_filters', +  'dev_guide.templates.filters', +  'dev_guide.templates.filters.using_filters', +  'dev_guide.templates', + +  'di', +  'module', +  'scope', +  'expression', +  'bootstrap', +  'directive', +  'compiler', + +  'forms', +  'animations', + +  'dev_guide.e2e-testing', +  'dev_guide.unit-testing', + +  'i18n', +  'ie', +  'migration', +]; + +function sidebarSort(a, b){ +  priorityA = GUIDE_PRIORITY.indexOf(a.id); +  priorityB = GUIDE_PRIORITY.indexOf(b.id); + +  if (priorityA > -1 || priorityB > -1) { +    return priorityA < priorityB ? -1 : (priorityA > priorityB ? 1 : 0); +  } +    function mangleName(doc) {      var path = doc.id.split(/\./);      var mangled = []; | 
