liquid-filter-reverse-string 0.1.0

Filter for the liquid template engine to reverse a string.
Documentation

Liquid filter for Rust to reverse a string

The liquid crate, the Rust implementation of the liquid template system has many filters to manipulate the data in the template, but AFAIK there is no filter to reverse a string.

This crate was originally developed as a demo on how to add a filter to liquid.

Usage:

let text = "{{ text | reversestr}}";
let globals = liquid::object!({
    "text": "Hello!",
});
let template = liquid::ParserBuilder::with_stdlib()
    .filter(ReverseStr)
    .build()
    .unwrap()
    .parse(text)
    .unwrap();
let output = template.render(&globals).unwrap();
assert_eq!(output, "!olleH".to_string());