Crate liquid [−] [src]
The Liquid templating language for Rust
[dependencies]
liquid = "0.8"
Example
use liquid::{Renderable, Context, Value}; let template = liquid::parse("Liquid! {{num | minus: 2}}", Default::default()).unwrap(); let mut context = Context::new(); context.set_val("num", Value::Num(4f32)); let output = template.render(&mut context); assert_eq!(output.unwrap(), Some("Liquid! 2".to_string()));
Modules
lexer |
Lexer |
parser |
Parser |
Structs
Context | |
LiquidOptions |
Options that liquid::parse takes |
Template |
Enums
Error | |
FilterError | |
Token | |
Value |
An enum to represent different value types |
Traits
Renderable |
Any object (tag/block) that can be rendered by liquid must implement this trait. |
Functions
parse |
Parses a liquid template, returning a Template object. |
Type Definitions
Block |
A trait for creating custom custom block-size tags ( |
Tag |
A trait for creating custom tags. This is a simple type alias for a function. |