jinja 0.1.0 copy "jinja: ^0.1.0" to clipboard
jinja: ^0.1.0 copied to clipboard

outdated

Jinja2 server-side template engine for Dart. Variables, expressions, control structures and template inheritance.

Jinja 2 for Dart 2 #

Pub

Jinja 2 server-side template engine port for Dart 2. Variables, expressions, control structures and template inheritance.

Done #

  • Loaders
    • FileSystemLoader
    • MapLoader (DictLoader)
  • Comments
  • Variables
  • Expressions: variables, literals, subscription, math, comparison, logic, tests, filters, calls
  • Filters (not all)
  • Tests
  • Statements
    • Filter
    • For (without recursive)
    • If
    • Set
    • Raw
    • Inlcude
    • Extends
    • Block

Using it #

Add package to your pubspec.yaml as a dependency

  dependencies:
    jinja: ^0.1.0

Import library and use it:

import 'package:jinja/jinja.dart';

// code ...

var template = Template('...source...');
// or
var env = Environment(blockStart: '...', ... );
var template = env.fromString('...source...');

template.render(key: value, );
// or 
template.renderMap({ 'key': value, });

Note: all variables and literals used in the template are dart objects with their own fields and methods.

Docs #

In progress ...

Contributing #

If you found a bug, just create a new issue or even better fork and issue a pull request with you fix.

Versioning #

The library will follow a [semantic versioning][semver]

32
likes
0
pub points
87%
popularity

Publisher

unverified uploader

Jinja2 server-side template engine for Dart. Variables, expressions, control structures and template inheritance.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta, path, string_scanner

More

Packages that depend on jinja