mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-04-13 11:21:15 +00:00
chore(docs): fix ordering of docs in the guide
This commit is contained in:
parent
8f989d652f
commit
a92b419551
1 changed files with 55 additions and 3 deletions
|
|
@ -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 = [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue