Skip to content
Myr

layout.py

This file

Path

tests/runtime/layout.py

13 lines · 392 bytes · Python

Last changed by

converted unit tests, started rewriting filtersChristoph Hackbefore adoptione9e43bb

History of this file

Take it

The walk stopped after 200 commits: lines older than 1f1823c point at it.

converted unit tests, started rewriting filtersChristoph Hackbefore adoptione9e43bb

line 1why, one step back
1from jinja2 import Environment, FileSystemLoader

[svn] jinja webpage without annyoing .html suffixes nowArmin Ronacherbefore adoption1f1823c

lines 2–3why, one step back
2e = Environment(loader=FileSystemLoader('templates'))
3

converted unit tests, started rewriting filtersChristoph Hackbefore adoptione9e43bb

lines 4–5why, one step back
4from jinja2.parser import Parser
5from jinja2.translators.python import PythonTranslator

[svn] jinja webpage without annyoing .html suffixes nowArmin Ronacherbefore adoption1f1823c

lines 6–13why, one step back
6
7print PythonTranslator(e, e.loader.parse('index.html')).translate()89tmpl = e.loader.load('index.html')10print tmpl.render(navigation_items=[{11 'url': '/',12 'caption': 'Index'13}])