Core Python Web Archiving Toolkit for replay and recording of web archives
GNU General Public License v3.0
1.34k
stars
207
forks
source link
Enable Expression Statement and Loop Control extensions for Jinja templates #844
Open
despens opened 1 year ago
Is your feature request related to a problem? Please describe.
I want to be able to manipulate lists and dictionaries in pywb templates without the result of the action ("
None
") needing to be printed. This is accomplished with thedo
tag which needs to be loaded via the Expression Statement extension.I want to be able to break out of a loop using the
break
tag, which needs to be loaded via the the Loop Controls extension.Describe the solution you'd like
pywb should by default load these basic Jinja extensions.
Describe alternatives you've considered
It is possible to suppress the
None
output of a list manipulation action using aset
capture block:However, it would be much nicer to just write
Likewise it is possible to write logic that can skip steps in a loop. But it would be much easier to just use the
{% break %}
statement.Additional context
Let's go nice templates! 😉