rdbo / dynja

Jinja pseudo-engine focused on DevEx and Performance
GNU Affero General Public License v3.0
22 stars 1 forks source link

Trait for render() method #3

Open Studiedlist opened 10 months ago

Studiedlist commented 10 months ago

It would be handy to have such trait since with current implementation, it is impossible to create generic function, that will render any minijinja or askama template

rdbo commented 10 months ago

I was doing that before, but the Askama syntax is:

use askama::Template;

In order to use a trait, you'd have to do

use dynja::{Template, TemplateTrait};

So I thought I would remove it. Although I'm also not a big fan to just placing a render function in the struct

rdbo commented 10 months ago

Maybe we could have a trait render function in the TemplateFile trait and also a render function implemented directly in the struct that just calls the one from the trait

Studiedlist commented 10 months ago

I think, it's a good option