RPGs4_sanity/environ.py

18 lines
502 B
Python
Raw Permalink Normal View History

2022-11-29 23:22:46 +01:00
# https://github.com/kolypto/j2cli#customization
# http://jinja.pocoo.org/docs/2.10/api/#jinja2.Environment
def j2_environment_params(): return dict(
autoescape = True,
trim_blocks = True,
lstrip_blocks = True,
keep_trailing_newline = True,
2023-06-24 15:04:50 +02:00
extensions = (
"jinja2.ext.do",
"jinja2.ext.loopcontrols"
),
2022-11-29 23:22:46 +01:00
)
def j2_environment(env): return (env.globals.update(
my_function = lambda v: 'my function says "{}"'.format(v),
), env)[1]