Skip to content

Commit cfc583c

Browse files
committed
a bit more about what encloses something
1 parent fa37be7 commit cfc583c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/src/html_generator.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,20 @@ class HtmlGeneratorInstance {
178178
void _generateJson() {
179179
File jsonFile = createOutputFile(out, 'index.json');
180180
String json = JSON.encode(documentedElements.map((ModelElement e) {
181-
Map data = {'name': e.name, 'href': e.href};
181+
// TODO: find a better string for type
182+
Map data = {
183+
'name': e.name,
184+
'href': e.href,
185+
'type': e.runtimeType.toString()
186+
};
182187
if (e is EnclosedElement) {
183-
data['enclosedElementName'] =
184-
(e as EnclosedElement).enclosingElement.name;
188+
EnclosedElement ee = e as EnclosedElement;
189+
data['enclosedBy'] = {
190+
'name': ee.enclosingElement.name,
191+
'type': ee.enclosingElement.runtimeType.toString()
192+
};
185193
}
194+
return data;
186195
}).toList());
187196
jsonFile.writeAsStringSync(json);
188197
}

0 commit comments

Comments
 (0)