jinja 0.4.0-dev.53
jinja: ^0.4.0-dev.53 copied to clipboard
Jinja2 template engine for Dart. Variables, expressions, control structures and template inheritance.
Jinja for Dart #
Jinja server-side template engine port for Dart 2. Variables, expressions, control structures and template inheritance.
0.4.0 version is breaking #
See CHANGELOG.md
.
Documentation #
Mostly same as Jinja template documentation. work in progress.
Differences #
BigInt
is not supported- Complex numbers are not supported
- The
default
filter compares values againstnull
- The
defined
andundefined
tests compares values againstnull
- The
Environment
finalizer
takes only onevalue
argument - work in progress
Dynamically invoked members #
[]
,+
,-
,*
,/
,~/
,%
operatorsobject.length
getterobject.call
getter- work in progress
Example #
import 'package:jinja/jinja.dart';
// ...
var environment = Environment(blockStart: '...', blockEnd: '...');
var template = environment.fromString('...source...');
sink.write(template.render({'key': value}));
See also examples with conduit and reflectable.
Status: #
TODO: #
- Environment
- constructor
- extensions
- selectAutoescape
- addExtension
- compileExpression
- constructor
- Template
- stream
- List of Control Structures
- Macros
- Call
- Import
- Loaders
- PackageLoader (VM)
- ...
- Extensions
- i18n
- Expression Statement
- Loop Controls
- Debug Statement
- Template compiler
- ...
Done: #
- 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
- Manual
- Automatic
- List of Control Structures
- For
- If
- Filters
- Assignments
- Block Assignments
- Extends
- Blocks
- Include
- Import Context Behavior
- Expressions with filters (not all) and tests
- List of Global Functions
- list
- namespace
- range
- Loaders
- FileSystemLoader
- MapLoader (DictLoader)
- Extensions
- Do Statement
- With Statement
- Autoescape Overrides
Contributing #
If you found a bug, typo or you have better description or comment for documentation, just create a new issue or even better fork and issue a pull request with your fix.