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

outdated

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

example/example.dart

import 'package:jinja/jinja.dart';

void main() {
  const source = '{% for user in users %}'
      '{{ user["fullname"] }}, {{ user["email"] }}; '
      '{% else %}No users{% endfor %}';

  final env = Environment();
  final template = env.fromString(source, path: 'index.html');

  print(template.render(users: [
    {'fullname': 'Jhon Doe', 'email': 'jhondoe@dev.py'},
    {'fullname': 'Jane Doe', 'email': 'janedoe@dev.py'},
  ]));
}
32
likes
0
pub points
86%
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