Skip to content
Myr

test.py

This file

Path

examples/basic/test.py

27 lines · 611 bytes · Python

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 57c9b6d point at it.

Disabled iron python support until new lexer is implemented.Armin Ronacherbefore adoption57c9b6d

lines 1–27why, one step back
1from jinja2 import Environment
2from jinja2.loaders import DictLoader34env = Environment(loader=DictLoader({5'child.html': u'''\6{% extends master_layout or 'master.html' %}7{% include helpers = 'helpers.html' %}8{% macro get_the_answer() %}42{% endmacro %}9{% title = 'Hello World' %}10{% block body %}11 {{ get_the_answer() }}12 {{ helpers.conspirate() }}13{% endblock %}14''',15'master.html': u'''\16<!doctype html>17<title>{{ title }}</title>18{% block body %}{% endblock %}19''',20'helpers.html': u'''\21{% macro conspirate() %}23{% endmacro %}22'''23}))242526tmpl = env.get_template("child.html")27print tmpl.render()