resolveIncludes function
Future<Document?>
resolveIncludes(
- Document? document,
- Directory currentDirectory,
- void onError(
- JaelError error
Expands all include[src]
tags within the template, and fills in the content of referenced files.
Implementation
Future<Document?> resolveIncludes(Document? document,
Directory currentDirectory, void Function(JaelError error)? onError) async {
if (document == null) {
return null;
}
var rootElement =
await _expandIncludes(document.root, currentDirectory, onError);
if (rootElement != null) {
return Document(document.doctype, rootElement);
} else {
return null;
}
}