jael3 7.0.0 icon indicating copy to clipboard operation
jael3: ^7.0.0 copied to clipboard

SDKDart

A simple server-side HTML templating engine for Dart. Comparable to Blade or Liquid.

Jael 3 #

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

A simple server-side HTML templating engine for Dart.

See documentation.

Installation #

In your pubspec.yaml:

dependencies:
  jael3: ^6.0.0

API #

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

import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'package:jael3/jael3.dart' as jael;

void myFunction() {
    const template = '''
<html>
  <body>
    <h1>Hello</h1>
    <img src=profile['avatar']>
  </body>
</html>
''';

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

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

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

1
likes
110
pub points
62%
popularity

Publisher

verified publisher icondukefirehawk.com

A simple server-side HTML templating engine for Dart. Comparable to Blade or Liquid.

Homepage
Repository (GitHub)

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

args, belatuk_code_buffer, belatuk_symbol_table, charcode, collection, matcher, source_span, string_scanner

More

Packages that depend on jael3