Crate liquid [−] [src]
The Liquid templating language for Rust
[dependencies]
liquid = "0.9"
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 | |
FnBlockParser | |
FnTagParser | |
LiquidOptions |
Options that |
LocalTemplateRepository |
|
Template |
Enums
Error | |
FilterError | |
Token | |
Value |
An enum to represent different value types |
Traits
ParseBlock |
A trait for creating custom custom block-size tags ( |
ParseBlockClone | |
ParseTag |
A trait for creating custom tags. This is a simple type alias for a function. |
ParseTagClone | |
Renderable |
Any object (tag/block) that can be rendered by liquid must implement this trait. |
TemplateRepository | |
TemplateRepositoryClone |
Functions
parse |
Parses a liquid template, returning a Template object. |
parse_file |
Parse a liquid template from a file, returning a |
Type Definitions
Array |
Type representing a Liquid array, payload of the |
FnParseBlock | |
FnParseTag | |
Object |
Type representing a Liquid object, payload of the |