jinja 0.6.5
jinja: ^0.6.5 copied to clipboard
Jinja2 template engine for Dart. Variables, expressions, control structures and template inheritance.
0.6.5 (diff) #
- Added:
- Expressions:
- Ternary operator (
condition ? trueValue : falseValue) as alternative to if-else expressions{{ user.isAdmin ? "Admin Panel" : "User Panel" }} {{ score > 60 ? "Pass" : "Fail" }} - Null coalescing operator (
??) equivalent toor{{ variable ?? "default" }} {{ var1 ?? var2 ?? "final" }}
- Ternary operator (
- Variable names now support
#and@characters{{ #var }}, {{ var# }}, {{ @variable }}
- Expressions:
- Fixed:
- Optimizer bug in dict literal constant evaluation
0.6.4 (diff) #
- Refactoring.
0.6.3 (diff) #
- Fix
autoReloadlogic. - Refactoring.
0.6.2 (diff) #
- Added:
- Statements:
try-catchblock:{% try %} {{ x / y }} {% catch exception %} {{ exception | runtimetype }}: {{ exception }} {% endtry %}
- Filters:
runtimetype
- Statements:
0.6.1 (diff) #
- Added:
- List slices
{{ list[start:stop] }}. UndefinedErrorexceptionUndefinedFactorytypedefEnvironment:Environment({UndefinedFactory undefined})argumentUndefinedFactory undefinedfield
Template:Template({UndefinedFactory undefined})argument
- Filters:
null(nonealias)
- List slices
0.6.0 (diff) #
- Bump SDK version to 3.3.0.
- Update dependencies.
- Internal changes.
chromeplatform tests.- Added:
- Statements:
importfrom
Template:Template.fromNode({globals})argumentglobalsfield
- Statements:
- Restored:
- Conditional and variable
extendsstatement variants - Choice, ignore missing and variable
includestatement 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
*argsand**kwargssupport
- 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:
macrocall
- Filters:
itemstitle
- Changed:
Environment:Environment({modifiers})argument type fromList<NodeVisitor>toList<Node Function(Node)>modifierstype fromList<NodeVisitor>toList<Node Function(Node)>scan(...)return type fromList<Node>toNodeparse(...)return type fromList<Node>toNode
Template:Template({modifiers})argument type fromList<NodeVisitor>toList<Node Function(Node)>
- Filters:
truncatearguments are now positional
- Removed:
Template:Template.fromNodes(...)constructor
- Statements:
autoescape
- Filters:
forceescapesafeunsafe
- Tests:
escaped
0.4.2 #
- Internal changes.
0.4.1 #
- Update links.
0.4.0 #
- Minimal SDK version: 2.18.0.
- Added:
passContextandpassEnvironmentfunctionsprintto globals{{ do print(name) }}EnvironmentEnvironment({lineCommentPrefix, lineStatementPrefix, newLine, autoReload, modifiers, templates})constructor argumentsautoReloadfieldlexerfieldlineCommentPrefixfieldlineStatementPrefixfieldloaderfieldmodifiersfieldnewLinefieldlexmethodscanmethodparsemethod
TemplateTemplate({path, lineCommentPrefix, lineStatementPrefix, newLine, modifiers, templates})constructor argumentsrenderTomethod
- Exceptions (was internal):
TemplateErrorTemplateSyntaxErrorTemplateAssertionErrorTemplateNotFoundTemplatesNotFoundTemplateRuntimeErrorFilterArgumentError
- Statements:
dowith
- Filters:
dictsortreplacereversesafeslicestriptagstruncatewordcountwordwrapitemmaptojson
- Test:
filtertest
- Changed:
FieldGettertype definition renamed toAttributeGetterdefaultfilter compare values withnull, no boolean argumentdefinedandundefinedtests compare values withnullEnvironmentEnvironment({getField})constructor argument renamed togetAttributegetFieldfield renamed togetAttribute
TemplateTemplate({parent})constructor argument renamed toenvironmentand doesn't copy the environmentrenderMapmethod renamed torender
Loader.listSourcesmethod renamed tolistTemplatesMapLoader.mappingfield renamed tosourcesFileSystemLoaderFileSystemLoader({paths})argument is now non-nullable, defaults to['templates']- moved to
package:jinja/loaders.dartlibrary
package:jinja/get_field.dartlibrary renamed topackage:jinja/reflection.dartgetFieldfunction renamed togetAttribute
- Removed:
Undefinedtype andmissingobjectEnvironment.undefinedmethodTemplate.rendermethodFileSystemLoader:FileSystemLoader({path, autoReload})argumentsautoReloadfielddirectoryfield
- Slices and negative indexes
- Conditional and variable
extendsstatement variants - Choice, ignore missing and variable
includestatement variants
- Internal changes