15 lines
491 B
Python
15 lines
491 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]
|