@@ -77,24 +77,19 @@ class CategoryConfiguration {
7777 /// A map of [CategoryDefinition.name] to [CategoryDefinition] objects.
7878 final Map <String , CategoryDefinition > categoryDefinitions;
7979
80- /// The defined order for categories.
81- List <String > categoryOrder;
82-
83- CategoryConfiguration ._(this .categoryDefinitions, this .categoryOrder);
80+ CategoryConfiguration ._(this .categoryDefinitions);
8481
8582 static CategoryConfiguration get empty {
86- return new CategoryConfiguration ._({}, [] );
83+ return new CategoryConfiguration ._({});
8784 }
8885
8986 static CategoryConfiguration fromYamlMap (
9087 YamlMap yamlMap, pathLib.Context pathContext) {
91- List <String > categoriesInOrder = [];
9288 Map <String , CategoryDefinition > newCategoryDefinitions = {};
9389 for (MapEntry entry in yamlMap.entries) {
9490 String name = entry.key.toString ();
9591 String displayName;
9692 String documentationMarkdown;
97- categoriesInOrder.add (name);
9893 var categoryMap = entry.value;
9994 if (categoryMap is Map ) {
10095 displayName = categoryMap['displayName' ]? .toString ();
@@ -111,8 +106,7 @@ class CategoryConfiguration {
111106 new CategoryDefinition (name, displayName, documentationMarkdown);
112107 }
113108 }
114- return new CategoryConfiguration ._(
115- newCategoryDefinitions, categoriesInOrder);
109+ return new CategoryConfiguration ._(newCategoryDefinitions);
116110 }
117111}
118112
@@ -1014,6 +1008,7 @@ class DartdocOptionContext {
10141008 optionSet['ambiguousReexportScorerMinConfidence' ].valueAt (context);
10151009 bool get autoIncludeDependencies =>
10161010 optionSet['autoIncludeDependencies' ].valueAt (context);
1011+ List <String > get categoryOrder => optionSet['categoryOrder' ].valueAt (context);
10171012 CategoryConfiguration get categories =>
10181013 optionSet['categories' ].valueAt (context);
10191014 List <String > get dropTextFrom => optionSet['dropTextFrom' ].valueAt (context);
@@ -1068,7 +1063,6 @@ Future<List<DartdocOption>> createDartdocOptions() async {
10681063 new DartdocOptionArgOnly <bool >('addCrossdart' , false ,
10691064 help: 'Add Crossdart links to the source code pieces.' ,
10701065 negatable: true ),
1071-
10721066 new DartdocOptionArgFile <double >(
10731067 'ambiguousReexportScorerMinConfidence' , 0.1 ,
10741068 help:
@@ -1077,6 +1071,10 @@ Future<List<DartdocOption>> createDartdocOptions() async {
10771071 help:
10781072 'Include all the used libraries into the docs, even the ones not in the current package or "include-external"' ,
10791073 negatable: true ),
1074+ new DartdocOptionArgFile <List <String >>('categoryOrder' , [],
1075+ help:
1076+ "A list of categories (not package names) to place first when grouping symbols on dartdoc's sidebar. "
1077+ 'Unmentioned categories are sorted after these.' ),
10801078 new DartdocOptionFileOnly <CategoryConfiguration >(
10811079 'categories' , CategoryConfiguration .empty,
10821080 convertYamlToType: CategoryConfiguration .fromYamlMap,
@@ -1206,7 +1204,7 @@ Future<List<DartdocOption>> createDartdocOptions() async {
12061204 new DartdocOptionArgOnly <List <String >>('packageOrder' , [],
12071205 help:
12081206 'A list of package names to place first when grouping libraries in packages. '
1209- 'Unmentioned categories are sorted after these.' ),
1207+ 'Unmentioned packages are sorted after these.' ),
12101208 new DartdocOptionArgOnly <bool >('sdkDocs' , false ,
12111209 help: 'Generate ONLY the docs for the Dart SDK.' , negatable: false ),
12121210 new DartdocOptionArgSynth <String >('sdkDir' ,
0 commit comments