jinja 0.0.5
jinja: ^0.0.5 copied to clipboard
Jinja2 server-side template engine for Dart. Variables, expressions, control structures and template inheritance. Try to make your own web apps with Jinja 2 templates in Dart 2.
example/README.md
Simple shelf server with Jinja 2 example
Example usage #
import 'package:jinja/jinja.dart';
void main() {
const source = '{% for user in users %}'
'{{ user["fullname"] }}, {{ user["email"] }};'
'{% else %}No users{% endfor %}';
var env = Environment();
var template = env.fromSource(source, path: 'index.html');
print(template.render(<String, dynamic>{
'users': <dynamic>[
{'fullname': 'Jhon Doe', 'email': 'jhondoe@unknown.dev'},
{'fullname': 'Jane Doe', 'email': 'janedoe@unknown.dev'},
]
}));
}