From a92b419551450573a8f71c562618159af68ad8e8 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Mon, 4 Nov 2013 11:31:27 -0800 Subject: chore(docs): fix ordering of docs in the guide --- docs/src/ngdoc.js | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) (limited to 'docs/src') 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 = []; -- cgit v1.2.3