Syntax sugar for Python Mako templates
Project description
Mako Sugar
===
A preprocessor that adds some syntactic sugar to Mako templates.
Write:
% call foo():
hi
% endcall
instead of:
<%call expr="foo()">
hi
</%call>
Install with:
from mako_sugar import sugar
# Any one of these options...
t = Template(..., preprocessor=sugar())
t = Template(..., preprocess=sugar(exclude=['def', 'call', 'import']))
TemplateLookup(preprocessor=sugar())
===
A preprocessor that adds some syntactic sugar to Mako templates.
Write:
% call foo():
hi
% endcall
instead of:
<%call expr="foo()">
hi
</%call>
Install with:
from mako_sugar import sugar
# Any one of these options...
t = Template(..., preprocessor=sugar())
t = Template(..., preprocess=sugar(exclude=['def', 'call', 'import']))
TemplateLookup(preprocessor=sugar())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mako_sugar-0.1.0.tar.gz
(3.7 kB
view hashes)