Skip to content
Embedded Dart Templates
Dart
Find file
Latest commit 1b3ebbf Aliaksandr Zhuhrou migration to the Dart SDK version 13387
Failed to load latest commit information.
bin problem with includes
lib
runtime
test migrate to dart sdk Dart SDK version 13387
.children
.project
AUTHORS
LICENSE.txt
Lib.dart migrate to dart sdk Dart SDK version 13387
README.md typo fix
RuntimeLib.dart
edt.dart

README.md

EDT

Embedded Dart Templates

Features

  • Template compilation to dart code.
  • Unbuffered code for conditions and loops {{ ..code.. }}
  • Html escaped expressions with {{= ..expression.. }}
  • Unescaped expressions with {{- ..expression.. }}
  • Static includes support with {{> relative_path }} where path is relative from a base template
  • More advanced layout system support (details here)

Example

Include content {{=data["third"]}} {{-data["forth"]}}

Where data is a special variable (which is Map) that you pass into EDTemplate#render(Map data, OutputStream out) method

Notes

  • This library is designed to work with server environment.
  • Tested for windows platform.
  • Currently templates should be UTF-8 encoded.

Compiler options

  • --out=dir_path - path to an output directory => for example ../test
  • --file=file_path - path to the template file => for example ../test/example.edt
  • --src=dir_path - path to an source directory where lookup for template files => for example ../src Be aware that currently we do not support absolute paths as the compiler parameter. All path should be relative to a worker directory.

An example of the syntax could be found in the test folder.

I also have recently released to a public a real life website example

Something went wrong with that request. Please try again.