expandAll method
The whole site expanded: its notation components, then its pages, with each overlay two pages write with one id and draw differently made the page's own.
Implementation
ExpandedNotationSite expandAll() {
Json copy(Json d) => jsonDecode(jsonEncode(d)) as Json;
final components = <ScopedComponent>[];
final results = <String, NotationResult>{};
for (final src in site.ordered()) {
final r = expand(src.text, screen: 'screen');
results[src.type] = r;
components.add((type: src.type, path: src.path, document: copy(r.document)));
}
final pages = <ScopedPage>[];
final pageResults = <NotationResult>[];
for (final page in site.pageSources) {
final r = expandPage(page);
pageResults.add(r);
pages.add((name: _stem(page), path: page, document: copy(r.document)));
}
final scoping = scopeOverlays(pages, components);
return (components: components, componentResults: results, pages: pages, results: pageResults, scoping: scoping);
}