Jinja server-side template engine port for Dart 2. Variables, expressions, control structures and template inheritance.
- no template variable imports.
- no
Template.renderMap
. Template.render
now acceptsMap<String, Object?>
.FileSystemLoader
moved frompackage:jinja/jinja.dart
topackage:jinja/loaders.dart
.- no
Undefined
andmissing
. - no slices and negative indexes.
- work in progress
Mostly same as Jinja template documentation.
work in progress
import 'package:jinja/jinja.dart';
// ...
final environment = Environment(blockStart: '...', blockEnd: '...');
final template = env.fromString('...source...');
sink.write(template.render({'key': value}));
See also examples with conduit and reflectable.
- Environment
- constructor
- extensions
- selectAutoescape
- addExtension
- compileExpression
- shared
- constructor
- Template
- generate
- stream
- List of Control Structures
- Macros
- Call
- Import
- Loaders
- PackageLoader
- ...
- Extensions
- i18n
- Expression Statement
- Loop Controls
- Debug Statement
- ... working
- Variables
- Filters
- Tests
- Comments
- Whitespace Control
- Escaping
- Line Statements
- Comments
- Blocks
- Template Inheritance
- Base Template
- Child Template
- Super Blocks
- Nesting extends
- Named Block End-Tags
- Block Nesting and Scope
- HTML Escaping
- Working with Manual Escaping
- Working with Automatic Escaping
- List of Control Structures
- For
- If
- Filters
- Assignments
- Block Assignments
- Extends
- Blocks
- Include
- Import Context Behavior
- Expressions
- List of Builtin Filters
- abs
- attr
- batch
- capitalize
- center
- default, d
- escape, e
- filesizeformat
- first
- float
- forceescape
- int
- join
- last
- length, count
- list
- lower
- random
- replace
- reverse
- safe
- string
- sum
- trim
- upper
- wordwrap
- List of Builtin Tests
- boolean
- callable
- defined
- divisibleby
- eq, equalto, ==
- escaped
- even
- false
- float
- ge, >=
- gt, greaterthan, >
- in
- integer
- iterable
- le, <=
- lower
- lt, lessthan, <
- mapping
- ne, !=
- none, undefined
- number
- odd
- sameas
- sequence
- string
- true
- upper
- List of Global Functions
- list
- namespace
- range
- Loaders
- FileSystemLoader
- MapLoader (DictLoader)
- Extensions
- With Statement
- Autoescape Overrides
If you found a bug, just create a new issue or even better fork and issue a pull request with your fix.