platform/packages/jael/jael_preprocessor
thomashii@dukefirehawk.com 1560e147cc Updated min SDK to 2.17
2022-08-13 10:14:43 +08:00
..
example Updated jael_preprocessor 2021-05-18 20:12:47 +08:00
lib Updated Jael to use belatuk_symbol_table 2021-09-13 08:30:02 +08:00
test Updated linter to package:lints 2021-09-25 14:32:32 +08:00
analysis_options.yaml Updated Jael to use belatuk_symbol_table 2021-09-13 08:30:02 +08:00
AUTHORS.md Restore jael to original name 2021-05-15 17:55:55 +08:00
CHANGELOG.md Fixed JAEL 2022-04-24 18:53:41 +08:00
LICENSE Updated Jael to use belatuk_symbol_table 2021-09-13 08:30:02 +08:00
melos_jael3_preprocessor.iml Added melos 2022-03-19 09:37:28 +08:00
mono_pkg.yaml Restore jael to original name 2021-05-15 17:55:55 +08:00
pubspec.yaml Updated min SDK to 2.17 2022-08-13 10:14:43 +08:00
README.md Updated README 2022-04-24 08:55:17 +08:00

Jael Ppreprocessor

Pub Version (including pre-releases) Null Safety Gitter License

A pre-processor for resolving blocks and includes within Jael 3 templates.

Installation

In your pubspec.yaml:

dependencies:
  jael3_prepreprocessor: ^6.0.0

Usage

It is unlikely that you will directly use this package, as it is more of an implementation detail than a requirement. However, it is responsible for handling include and block directives (template inheritance), so you are a package maintainer and want to support Jael, read on.

To keep things simple, just use the resolve function, which will take care of inheritance for you.

import 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael;

myFunction() async {
  var doc = await parseTemplateSomehow();
  var resolved = await jael.resolve(doc, dir, onError: (e) => doSomething());
}

You may occasionally need to manually patch in functionality that is not available through the official Jael packages. To achieve this, simply provide an Iterable of Patcher functions:

myOtherFunction(jael.Document doc) {
  return jael.resolve(doc, dir, onError: errorHandler, patch: [
    syntactic(),
    sugar(),
    etc(),
  ]);
}

This package uses package:file, rather than dart:io.