jinja 0.6.0 jinja: ^0.6.0 copied to clipboard
Jinja2 template engine for Dart. Variables, expressions, control structures and template inheritance.
0.6.0 ( #
- bump SDK version to 3.3.0.
- update dependencies.
- internal changes.
chrome
platform tests.- added:
- statements:
import
from
Template
:Template.fromNode({globals})
argumentglobals
field
- statements:
- restored:
- conditional and variable
extends
statement variants - choice, ignore missing and variable
include
statement variants
- conditional and variable
- changed:
Environment
:Environment.lex()
return fromList<Token>
toIterable<Token>
Environment.scan(tokens)
argument type fromList<Token>
toIterable<Token>
- removed:
- exceptions:
FilterArgumentError
*args
and**kwargs
support
- exceptions:
0.5.0 #
- minimal SDK version: 3.0.0.
- internal changes.
- added:
Template
:Template.fromNode(Environment environment, {String? path, required Node body})
constructor
- statements:
macro
call
- filters:
items
title
- changed:
Environment
:Environment({modifiers})
argument type fromList<NodeVisitor>
toList<Node Function(Node)>
modifiers
type fromList<NodeVisitor>
toList<Node Function(Node)>
scan(...)
return type fromList<Node>
toNode
parse(...)
return type fromList<Node>
toNode
Template
:Template({modifiers})
argument type fromList<NodeVisitor>
toList<Node Function(Node)>
- filters:
truncate
arguments are now positional
- removed:
Template
:Template.fromNodes(...)
constructor
- statements:
autoescape
- filters:
forceescape
safe
unsafe
- tests:
escaped
0.4.2 #
- internal changes.
0.4.1 #
- update links.
0.4.0 #
- minimal SDK version: 2.18.0.
- added:
passContext
andpassEnvironment
functionsprint
to globals{{ do print(name) }}
Environment
Environment({lineCommentPrefix, lineStatementPrefix, newLine, autoReload, modifiers, templates})
constructor argumentsautoReload
fieldlexer
fieldlineCommentPrefix
fieldlineStatementPrefix
fieldloader
fieldmodifiers
fieldnewLine
fieldlex
methodscan
methodparse
method
Template
Template({path, lineCommentPrefix, lineStatementPrefix, newLine, modifiers, templates})
constructor argumentsrenderTo
method
- exceptions are public now:
TemplateError
TemplateSyntaxError
TemplateAssertionError
TemplateNotFound
TemplatesNotFound
TemplateRuntimeError
FilterArgumentError
- statements:
do
with
- filters:
dictsort
replace
reverse
safe
slice
striptags
truncate
wordcount
wordwrap
item
map
tojson
- test:
filter
test
- changed:
FieldGetter
typedef renamed toAttributeGetter
default
filter compare values withnull
, no boolean argumentdefined
andundefined
tests compare values withnull
Environment
Environment({getField})
constructor argument renamed togetAttribute
getField
field renamed togetAttribute
Template
Template({parent})
constructor argument renamed toenvironment
and doesn't copy the environmentrenderMap
method renamed torender
Loader.listSources
method renamed tolistTemplates
MapLoader.mapping
field renamed tosources
FileSystemLoader
FileSystemLoader({paths})
argument now non-nullable, defaults to['templates']
- moved to
package:jinja/loaders.dart
library
package:jinja/get_field.dart
library renamed topackage:jinja/reflection.dart
getField
function renamed togetAttribute
- removed:
Undefined
type andmissing
objectEnvironment.undefined
methodTemplate.render
methodFileSystemLoader
:FileSystemLoader({path, autoReload})
argumentsautoReload
fielddirectory
field
- slices and negative indexes
- conditional and variable
extends
statement variants - choice, ignore missing and variable
include
statement variants
- internal changes
- work in progress