jinja 0.0.8 copy "jinja: ^0.0.8" to clipboard
jinja: ^0.0.8 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.fromSource(source, path: 'index.html');

  print(template.render({
    'users': [
      {'fullname': 'Jhon Doe', 'email': '[email protected]'},
      {'fullname': 'Jane Doe', 'email': '[email protected]'},
    ]
  }));
}
47
likes
0
points
25.3k
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

path, petitparser, string_scanner

More

Packages that depend on jinja