tera_v1/
lib.rs

1#![doc(html_root_url = "https://docs.rs/tera/0.11")]
2
3//! # Tera
4//! Tera is a template engine based on [Jinja2](http://jinja.pocoo.org/)
5//! and the [Django template language](https://docs.djangoproject.com/en/1.9/topics/templates/).
6//!
7//! See the [site](https://tera.netlify.com) for features and to get started.
8
9#![deny(missing_docs)]
10
11extern crate globwalk;
12extern crate pest;
13extern crate serde;
14#[cfg_attr(test, macro_use)]
15extern crate serde_json;
16#[macro_use]
17extern crate pest_derive;
18extern crate regex;
19extern crate slug;
20#[macro_use]
21extern crate lazy_static;
22extern crate chrono;
23extern crate humansize;
24extern crate url;
25#[cfg(test)]
26#[macro_use]
27extern crate pretty_assertions;
28#[cfg(test)]
29extern crate tempfile;
30#[cfg(test)]
31#[macro_use]
32extern crate serde_derive;
33extern crate unic_segment;
34extern crate v_htmlescape;
35
36#[macro_use]
37mod macros;
38mod builtins;
39mod context;
40mod errors;
41mod parser;
42mod renderer;
43mod sort_utils;
44mod template;
45mod tera;
46mod utils;
47
48// Library exports.
49
50// Template is meant to be used internally only but is exported for test/bench.
51pub use crate::builtins::filters::Filter;
52pub use crate::builtins::functions::Function;
53pub use crate::builtins::testers::Test;
54pub use crate::context::Context;
55pub use crate::errors::{Error, ErrorKind, Result};
56#[doc(hidden)]
57pub use crate::template::Template;
58pub use crate::tera::Tera;
59pub use crate::utils::escape_html;
60/// Re-export Value and other useful things from serde
61/// so apps/tools can encode data in Tera types
62pub use serde_json::value::{from_value, to_value, Map, Number, Value};
63
64// Exposes the AST if one needs it but changing the AST is not considered
65// a breaking change so it isn't public
66#[doc(hidden)]
67pub use crate::parser::ast;