Changelog:
0.5
- A Template is explicitly disallowed
from having a url that normalizes to relative outside
of the root. That is, if the Lookup is based
at /home/mytemplates, an include that would place
the ultimate template at
/home/mytemplates/../some_other_directory,
i.e. outside of /home/mytemplates,
is disallowed. This usage was never intended
despite the lack of an explicit check.
The main issue this causes
is that module files can be written outside
of the module root (or raise an error, if file perms aren't
set up), and can also lead to the same template being
cached in the lookup under multiple, relative roots.
TemplateLookup instead has always supported multiple
file roots for this purpose.
[ticket:174]
0.4.2
- Fixed bug regarding <%call>/def calls w/ content
whereby the identity of the "caller" callable
inside the <%def> would be corrupted by the
presence of another <%call> in the same block.
[ticket:170]
- Fixed the babel plugin to accommodate <%block>
[ticket:169]
0.4.1
- New tag: <%block>. A variant on <%def> that
evaluates its contents in-place.
Can be named or anonymous,
the named version is intended for inheritance
layouts where any given section can be
surrounded by the <%block> tag in order for
it to become overrideable by inheriting
templates, without the need to specify a
top-level <%def> plus explicit call.
Modified scoping and argument rules as well as a
more strictly enforced usage scheme make it ideal
for this purpose without at all replacing most
other things that defs are still good for.
Lots of new docs. [ticket:164]
- a slight adjustment to the "highlight" logic
for generating template bound stacktraces.
Will stick to known template source lines
without any extra guessing. [ticket:165]
0.4.0
- A 20% speedup for a basic two-page
inheritance setup rendering
a table of escaped data
(see http://techspot.zzzeek.org/2010/11/19/quick-mako-vs.-jinja-speed-test/).
A few configurational changes which
affect those in the I-don't-do-unicode
camp should be noted below.
- The FastEncodingBuffer is now used
by default instead of cStringIO or StringIO,
regardless of whether output_encoding
is set to None or not. FEB is faster than
both. Only StringIO allows bytestrings
of unknown encoding to pass right
through, however - while it is of course
not recommended to send bytestrings of unknown
encoding to the output stream, this
mode of usage can be re-enabled by
setting the flag bytestring_passthrough
to True.
- disable_unicode mode requires that
output_encoding be set to None - it also
forces the bytestring_passthrough flag
to True.
- the <%namespace> tag raises an error
if the 'template' and 'module' attributes
are specified at the same time in
one tag. A different class is used
for each case which allows a reduction in
runtime conditional logic and function
call overhead. [ticket:156]
- the keys() in the Context, as well as
it's internal _data dictionary, now
include just what was specified to
render() as well as Mako builtins
'caller', 'capture'. The contents
of __builtin__ are no longer copied.
Thanks to Daniel Lopez for pointing
this out. [ticket:159]
syntax which compiles into Python modules for maximum performance. Mako's
syntax and API borrows from the best ideas of many others, including Django
templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded
Python (i.e. Python Server Page) language, which refines the familiar ideas of
componentized layout and inheritance to produce one of the most straightforward
and flexible models available, while also maintaining close ties to Python
calling and scoping semantics.