RPGs4_sanity/environ.py

18 lines
502 B
Python

# 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,
extensions = (
"jinja2.ext.do",
"jinja2.ext.loopcontrols"
),
)
def j2_environment(env): return (env.globals.update(
my_function = lambda v: 'my function says "{}"'.format(v),
), env)[1]