diff options
Diffstat (limited to 'examples/basic/test.py')
-rw-r--r-- | examples/basic/test.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/examples/basic/test.py b/examples/basic/test.py index 04a6adc..80b9d1f 100644 --- a/examples/basic/test.py +++ b/examples/basic/test.py @@ -3,8 +3,10 @@ from __future__ import print_function from jinja2 import Environment from jinja2.loaders import DictLoader -env = Environment(loader=DictLoader({ -'child.html': u'''\ +env = Environment( + loader=DictLoader( + { + "child.html": u"""\ {% extends master_layout or 'master.html' %} {% include helpers = 'helpers.html' %} {% macro get_the_answer() %}42{% endmacro %} @@ -13,15 +15,17 @@ env = Environment(loader=DictLoader({ {{ get_the_answer() }} {{ helpers.conspirate() }} {% endblock %} -''', -'master.html': u'''\ +""", + "master.html": u"""\ <!doctype html> <title>{{ title }}</title> {% block body %}{% endblock %} -''', -'helpers.html': u'''\ +""", + "helpers.html": u"""\ {% macro conspirate() %}23{% endmacro %} -''' -})) +""", + } + ) +) tmpl = env.get_template("child.html") print(tmpl.render()) |