Rust-DTL
========
[![Build Status](https://travis-ci.org/tesjin/rust-dtl.svg?branch=master)](https://travis-ci.org/tesjin/rust-dtl)
[![Coverage Status](https://coveralls.io/repos/tesjin/rust-dtl/badge.svg?branch=master)](https://coveralls.io/r/tesjin/rust-dtl?branch=master)
[![Crates.io Status](http://meritbadge.herokuapp.com/dtl)](https://crates.io/crates/dtl)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/tesjin/rust-dtl/master/LICENSE)
Rust-DTL compiles Django Template Language.
This project is inspired by ideas:
Hello, {{username}}!
{% block content %}Some text...{% endblock %}
``` ###### `main.rs` ``` extern crate dtl; use std::path::Path; use std::error::Error; use dtl::{Context, Template}; fn main() { let mut ctx = Context::new(); ctx.set("username", Box::new("Ivan Ivanov".to_string())); ctx.set("test_var", Box::new("test-barstring".to_string())); let mut tpl = Template::new(Path::new("welcome.html"), Path::new("examples/views/")); match tpl.compile() { Ok(_) => {}, Err(e) => panic!("{}", e), }; println!("{}", tpl.render(&mut ctx)); } ``` ###### `output` ```Hello, Ivan Ivanov!
replacing the base content - variable: test-barstring after variable some text
``` License ------- Rust-DTL is released under the MIT license.