diff --git a/angel_jael/README.md b/angel_jael/README.md index fcb38bf6..a5f544f4 100644 --- a/angel_jael/README.md +++ b/angel_jael/README.md @@ -77,5 +77,7 @@ main() async { var server = await app.startServer(null, 3000); print('Listening at http://${server.address.address}:${server.port}'); } +``` -``` \ No newline at end of file +To apply additional transforms to parsed documents, provide a +set of `patch` functions, like in `package:jael_preprocessor`. \ No newline at end of file diff --git a/angel_jael/lib/angel_jael.dart b/angel_jael/lib/angel_jael.dart index e5dbf03d..1484d568 100644 --- a/angel_jael/lib/angel_jael.dart +++ b/angel_jael/lib/angel_jael.dart @@ -10,8 +10,10 @@ import 'package:symbol_table/symbol_table.dart'; /// /// To enable "minified" output, you need to override the [createBuffer] function, /// to instantiate a [CodeBuffer] that emits no spaces or line breaks. +/// +/// To apply additional transforms to parsed documents, provide a set of [patch] functions. AngelConfigurer jael(Directory viewsDirectory, - {String fileExtension, bool cacheViews: false, CodeBuffer createBuffer()}) { + {String fileExtension, bool cacheViews: false, Iterable patch, CodeBuffer createBuffer()}) { var cache = {}; fileExtension ??= '.jl'; createBuffer ??= () => new CodeBuffer(); @@ -31,7 +33,7 @@ AngelConfigurer jael(Directory viewsDirectory, processed = doc; try { - processed = await resolve(doc, viewsDirectory, onError: errors.add); + processed = await resolve(doc, viewsDirectory, patch: patch, onError: errors.add); } catch (_) { // Ignore these errors, so that we can show syntax errors. } diff --git a/angel_jael/pubspec.yaml b/angel_jael/pubspec.yaml index 5afcf75e..3a24dec4 100644 --- a/angel_jael/pubspec.yaml +++ b/angel_jael/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_jael -version: 1.0.0-alpha +version: 1.0.0-alpha+1 description: Angel support for the Jael templating engine. author: Tobe O homepage: https://github.com/angel-dart/jael/tree/master/jael