jael 1.0.6+1

  • README.md
  • Example
  • Installing
  • Versions
  • 29


Pub build status

A simple server-side HTML templating engine for Dart.

See documentation.


In your pubspec.yaml:

  jael: ^1.0.0


The core jael package exports classes for parsing Jael templates, an AST library, and a Renderer class that generates HTML on-the-fly.

import 'package:code_buffer/code_buffer.dart';
import 'package:jael/jael.dart' as jael;
import 'package:symbol_table/symbol_table.dart';

void myFunction() {
    const template = '''
    <img src=profile['avatar']>

    var buf = new CodeBuffer();
    var document = jael.parseDocument(template, sourceUrl: 'test.jl', asDSX: false);
    var scope = new SymbolTable(values: {
      'profile': {
        'avatar': 'thosakwe.png',

    const jael.Renderer().render(document, buf, scope);

Pre-processing (i.e. handling of blocks and includes) is handled by package:jael_preprocessor..


  • Ensure <element> pass attributes.


  • Add index-as to for-each.
  • Support registering + rendering custom elements.
  • Improve handling of booleans in non-strict mode.


  • Add support for DSX, a port of JSX to Dart.


  • Skip HTML comments in free text.


  • Fix a scanner bug that prevented proper parsing of HTML nodes followed by free text.
  • Don't trim <textarea> content.


  • Use package:dart2_constant.
  • Upgrade package:symbol_table.
  • Added Renderer.errorDocument.


  • Reworked the scanner; thereby fixing an extremely pesky bug that prevented successful parsing of Jael files containing JavaScript.


import 'dart:io';
import 'package:charcode/charcode.dart';
import 'package:code_buffer/code_buffer.dart';
import 'package:jael/jael.dart' as jael;
import 'package:symbol_table/symbol_table.dart';

main() {
  while (true) {
    var buf = new StringBuffer();
    int ch;
    print('Enter lines of Jael text, terminated by CTRL^D.');
    print('All environment variables are injected into the template scope.');

    while ((ch = stdin.readByteSync()) != $eot && ch != -1) {

    var document = jael.parseDocument(
      sourceUrl: 'stdin',
      onError: stderr.writeln,

    if (document == null) {
      stderr.writeln('Could not parse the given text.');
    } else {
      var output = new CodeBuffer();
      const jael.Renderer().render(
        new SymbolTable(values: Platform.environment),
        strictResolution: false,
      print('GENERATED HTML:\n$output');

Use this package as a library

1. Depend on it

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

  jael: ^1.0.6+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/jael.dart';
Version Uploaded Documentation Archive
1.0.6+1 Jun 28, 2018 Go to the documentation of jael 1.0.6+1 Download jael 1.0.6+1 archive
1.0.6 Jun 28, 2018 Go to the documentation of jael 1.0.6 Download jael 1.0.6 archive
1.0.5 Jun 26, 2018 Go to the documentation of jael 1.0.5 Download jael 1.0.5 archive
1.0.4 Apr 3, 2018 Go to the documentation of jael 1.0.4 Download jael 1.0.4 archive
1.0.3 Apr 3, 2018 Go to the documentation of jael 1.0.3 Download jael 1.0.3 archive
1.0.2 Apr 3, 2018 Go to the documentation of jael 1.0.2 Download jael 1.0.2 archive
1.0.1 Apr 3, 2018 Go to the documentation of jael 1.0.1 Download jael 1.0.1 archive
1.0.0 Nov 28, 2017 Go to the documentation of jael 1.0.0 Download jael 1.0.0 archive
1.0.0-beta+3 Oct 17, 2017 Go to the documentation of jael 1.0.0-beta+3 Download jael 1.0.0-beta+3 archive
1.0.0-beta+2 Oct 16, 2017 Go to the documentation of jael 1.0.0-beta+2 Download jael 1.0.0-beta+2 archive

All 18 versions...

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 20, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.12.4


Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 Because jael depends on symbol_table <2.0.0 which requires SDK version >=1.19.0 <2.0.0, version solving failed.

Health suggestions

Format lib/src/renderer.dart.

Run dartfmt to format lib/src/renderer.dart.

Format lib/src/text/parser.dart.

Run dartfmt to format lib/src/text/parser.dart.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <=2.0.0