add missing files

main
Peder Bergebakken Sundt 2022-11-29 23:22:46 +01:00
parent 7a2d4c5801
commit dd3182f385
2 changed files with 20 additions and 0 deletions

14
environ.py Normal file
View File

@ -0,0 +1,14 @@
# 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]

6
filters.py Normal file
View File

@ -0,0 +1,6 @@
#from jinja2 import Markup
import json
def to_json(obj):
#return Markup(json.dumps(obj))
return json.dumps(obj)