template_engine 0.0.2 copy "template_engine: ^0.0.2" to clipboard
template_engine: ^0.0.2 copied to clipboard

A Dart package to parse and render templates, using (nested) variables and custom tags.

A flexible Dart library to parse templates and render output such as:

Features #

  • Use variables and nested variables

Getting started #

See: Installing

Usage #

import 'package:template_engine/template_engine.dart';

void main() {
  var template = TextTemplate('Hello {{name}}.');
  // See also FileTemplate and WebTemplate
  var engine = TemplateEngine(variables: {'name': 'world'});
  var model = engine.parse(template);
  // Here you could additionally mutate or validate the model if needed.
  print(engine.render(model)); // should print 'Hello world.';
}

For more see: Examples

3
likes
140
pub points
55%
popularity

Publisher

unverified uploader

A Dart package to parse and render templates, using (nested) variables and custom tags.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, petitparser, recase

More

Packages that depend on template_engine