askama icon indicating copy to clipboard operation
askama copied to clipboard

is it possible to use imports with filters, or make the import an expression?

Open rivasdiaz opened this issue 2 years ago • 1 comments

Hi, I'm trying to use askama to generate YAML files, and I was trying to import a common part of YAML file into multiple templates. That works fine using the import statement, but the problem is they need to be indented in different positions. I was trying to use the indent filter, but I couldn't make it work with an import statement. I wonder if it would be possible to use an import as an expression so we could apply filters to it.

Thanks!

rivasdiaz avatar Nov 04 '23 21:11 rivasdiaz

No, that's not currently possible, and I don't think it would be trivial to do.

djc avatar Nov 06 '23 08:11 djc