jinja 0.4.0-dev.53 copy "jinja: ^0.4.0-dev.53" to clipboard
jinja: ^0.4.0-dev.53 copied to clipboard

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

Jinja for Dart #

Pub

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 against null
  • The defined and undefined tests compares values against null
  • The Environment finalizer takes only one value argument
  • work in progress

Dynamically invoked members #

  • [], +, -, *, /, ~/, % operators
  • object.length getter
  • object.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
  • 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
    • print
    • 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.

32
likes
0
pub points
87%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta, path, string_scanner, textwrap

More

Packages that depend on jinja