jael_preprocessor 2.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 70

jael_preprocessor #

Pub build status

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

Installation #

In your pubspec.yaml:

  jael_prepreprocessor: ^1.0.0-alpha

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:jael_preprocessor/jael_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: [

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

2.0.1 #

  • Fixed a bug where failed file resolutions would not become proper errors.

2.0.0+1 #

  • Homepage update for Pub.

2.0.0 #

  • Dart 2 updates.
  • Fix a templating bug where multiple inheritance did not work.

1.0.0+1 #

  • Minor change to Patcher signature for Dart 2 compatibility.


import 'dart:async';

import 'package:file/file.dart';
import 'package:jael/jael.dart' as jael;
import 'package:jael_preprocessor/jael_preprocessor.dart' as jael;

Future<jael.Document> process(
    jael.Document doc, Directory dir, errorHandler(jael.JaelError e)) {
  return jael.resolve(doc, dir, onError: errorHandler, patch: [
    (doc, dir, onError) {
      return doc;

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  jael_preprocessor: ^2.0.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:jael_preprocessor/jael_preprocessor.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21


Detected platforms: other

Primary library: package:jael_preprocessor/jael_preprocessor.dart with components: io, mirrors.

Health suggestions

Fix lib/jael_preprocessor.dart. (-0.50 points)

Analysis of lib/jael_preprocessor.dart reported 1 hint:

line 304 col 7: DO use curly braces for all flow control structures.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
file ^5.0.0 5.1.0
jael ^2.0.0 2.0.2
symbol_table ^2.0.0 2.0.0
Transitive dependencies
args 1.5.2
charcode 1.1.2
intl 0.16.0
meta 1.1.7
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
Dev dependencies
code_buffer any 1.0.1
test ^1.0.0