Vincent Prouillet
Vincent Prouillet
I am looking at https://github.com/tokio-rs/valuable/pull/59 which would be required for Tera
You can access a template AST, it's just not visible in the documentation since the AST is not stable.
It would be nice to have context local functions, it was pulled from v1 due to some breaking changes but it's on the table for v2
That's extremely unlikely to happen. Tera is not only used for rendering HTML so it can't just change its syntax for one usecase. Something like https://jinja.palletsprojects.com/en/3.0.x/templates/#call is likely to be...
Isn't that `Tera::default()`?
Yep, accessing the context from filters/functions is definitely something I want to add, partly for Zola as well (so we don't do `lang=lang` etc)
Yep, I have a version currently written with https://github.com/maciejhirsz/logos and started another with no dependencies at all. Note that I haven't touched it for a while, I'll resume after the...
If you're sure the value is defined, you can use `or` which works on falsy values.
Hm I would check what Jinja2 and others do in that case. It seems pretty unlikely to me that a literal in a template would have all 3 kinds
It gives an error because only positive integers are allowed and we're trying to cast `n` as `usize`. Otherwise it's always an empty string.