pub fn snake_case<S: BuildHasher>(
value: &Value,
_: &HashMap<String, Value, S>,
) -> Result<Value>Expand description
Converts text into snake_case.
ยงExample
use tera::{Context, Tera};
use tera_text_filters::snake_case;
let mut ctx = Context::new();
ctx.insert("i", "soMe Text");
let mut tera = Tera::default();
tera.register_filter("snake_case", snake_case);
let i = "{{ i | snake_case }}";
let rendered = tera.render_str(i, &ctx).unwrap();
assert_eq!(rendered, "some_text");