twig_dart_preprocessor library

Functions

allChildrenOfRegularElement(RegularElement el, Map<String?, RegularElement> definedOverrides, void onError(dynamic e)?, bool replaceWithDefault, bool anyTemplatesRemain) List<ElementChild>
applyInheritance(Document document, Directory currentDirectory, void onError(dynamic error)?, Iterable<Patcher>? patch) Future<Document?>
Folds any extend declarations.
findBlockOverrides(Element tmpl, void onError(TwigDartError e)?) Map<String?, RegularElement>
getParent(Document document, void onError(dynamic error)?) String?
Finds the name of the parent template.
replaceBlocks(Element element, Map<String?, RegularElement> definedOverrides, void onError(dynamic e)?, bool replaceWithDefault, bool anyTemplatesRemain) Iterable<ElementChild>
replaceChildrenOfElement(Element el, Map<String, RegularElement> definedOverrides, void onError(dynamic e)?, bool replaceWithDefault, bool anyTemplatesRemain) → Element
replaceChildrenOfRegularElement(RegularElement el, Map<String?, RegularElement> definedOverrides, void onError(dynamic e)?, bool replaceWithDefault, bool anyTemplatesRemain) → RegularElement
resolve(Document document, Directory currentDirectory, {void onError(dynamic error)?, Iterable<Patcher>? patch}) Future<Document?>
Expands all block[name] tags within the template, replacing them with the correct content.
resolveHierarchy(Document document, Directory currentDirectory, void onError(dynamic e)?) Future<DocumentHierarchy?>
Resolves the document hierarchy at a given node in the tree.
resolveIncludes(Document document, Directory currentDirectory, void onError(dynamic error)?) Future<Document>
Expands all include[src] tags within the template, and fills in the content of referenced files.

Typedefs

Patcher = FutureOr<Document>? Function(Document? document, Directory currentDirectory, void onError(TwigDartError error)?)
Modifies a twig document.