File tree 1 file changed +13
-11
lines changed
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ class HtmlGeneratorInstance implements HtmlOptions {
62
62
var encoder =
63
63
prettyIndexJson ? new JsonEncoder .withIndent (' ' ) : new JsonEncoder ();
64
64
65
- File jsonFile = _createOutputFile (path.join (out.path, 'index.json' ));
66
- String json = encoder.convert (
65
+ final List <Map > indexItems =
67
66
documentedElements.where ((e) => e.isCanonical).map ((ModelElement e) {
68
67
Map data = {
69
68
'name' : e.name,
@@ -82,15 +81,18 @@ class HtmlGeneratorInstance implements HtmlOptions {
82
81
data['qualifiedName' ] = e.fullyQualifiedName;
83
82
}
84
83
return data;
85
- }).toList ()
86
- ..sort ((a, b) {
87
- var value = compareNatural (a['qualifiedName' ], b['qualifiedName' ]);
88
- if (value == 0 ) {
89
- value = compareNatural (a['type' ], b['type' ]);
90
- }
91
- return value;
92
- }));
93
- jsonFile.writeAsStringSync ('${json }\n ' );
84
+ }).toList ();
85
+
86
+ indexItems.sort ((a, b) {
87
+ var value = compareNatural (a['qualifiedName' ], b['qualifiedName' ]);
88
+ if (value == 0 ) {
89
+ value = compareNatural (a['type' ], b['type' ]);
90
+ }
91
+ return value;
92
+ });
93
+
94
+ String json = encoder.convert (indexItems);
95
+ _writeFile (path.join (out.path, 'index.json' ), '${json }\n ' );
94
96
}
95
97
96
98
void _generateDocs () {
You can’t perform that action at this time.
0 commit comments