blob: 632b902dce0a3c0e24237ba825e0eb3198bddfb0 [file] [log] [blame]
Armin Ronachera22a53d2007-03-31 20:44:33 +02001Jinja Changelog
2===============
3
Armin Ronachera7804ef2007-06-15 18:03:21 +02004Version 1.2
5-----------
Armin Ronacher825e5222007-11-16 16:16:23 +01006(codename to be hatsuyuki, released Nov 17th 2007)
7
8.. admonition:: Backwards Incompatible Changes
9
10 - `call` is a keyword now
11 - the internal parser AST changed
12 - `extends` must be the first tag in a template
13 - the tuple literal yields tuples now, instead of lists.
Armin Ronachera7804ef2007-06-15 18:03:21 +020014
15- environments now have a `translator_factory` parameter that allows
16 to change the translator without subclassing the environment.
17
18- fixed bug in buffet plugin regarding the package loader
19
20- once again improved debugger.
21
Armin Ronachere39a5d22007-06-23 21:11:53 +020022- added `groupby` filter.
23
Armin Ronacher69ddc582007-06-24 12:37:13 +020024- added `sameas` test function.
25
Armin Ronacher1cc232c2007-09-07 17:52:41 +020026- standalone parser. Jinja does not use the python parser any more and will
27 continue having the same semantics in any future python versions. This
28 was done in order to simplify updating Jinja to 2.6 and 3.0 and to support
29 non python syntax.
30
31- added support for ``expr1 if test else expr2`` (conditional expressions)
32
33- ``foo.0`` as alias for ``foo[0]`` is possible now. This is mainly for
34 django compatibility.
35
36- the filter operators has a much higher priority now which makes it
37 possible to do ``foo|filter + bar|filter``.
38
39- new AST. the return value of `Environment.parse` is now a Jinja AST and not
40 a Jinja-Python AST. This is also the only backwards incompatible change but
41 should not affect many users because this feature is more or less
42 undocumented and has few use cases.
43
44- tuple syntax returns tuples now and not lists any more.
45
46- the print directive and ``{{ variable }}`` syntax now accepts and implicit
47 tuple like the `for` and `cycle` tags. (``{{ 1, 2 }}`` is an implicit alias
48 for ``{{ (1, 2) }}` like ``{% for a, b in seq %}`` is for
49 ``{% for (a, b) in seq %}``.
50
51- tests called with *one* parameter don't need parentheses. This gives a more
52 natural syntax for the `sameas` test and some others:
53 ``{{ foo is sameas bar }}`` instead of ``{{ foo is sameas(bar) }}``. If you
54 however want to pass more than one argument you have to use parentheses
55 because ``{{ foo is sometest bar, baz }}`` is handled as
56 ``{{ (foo is sometest(bar), baz) }}``, so as tuple expression.
57
58- removed support for octal character definitions in strings such as
59 ``'\14'``, use ``'\x0c'`` now.
60
61- added regular expression literal. ``@/expr/flags`` equals
62 ``re.compile(r'(?flags)expr')``. This is useful for the `matching` test and
63 probably some others.
64
65- added set literal. We do not use python3's {1, 2} syntax because
66 this conflicts with the dict literal. To be compatible with the regex
67 literal we use ``@(1, 2)`` instead.
68
69- fixed bug in `get_attribute` that disallowed retreiving attributes of objects
70 without a `__class__` such as `_sre.SRE_Pattern`.
71
72- addded `django.contrib.jinja` which provides advanced support for django.
73 (thanks Bryan McLemore)
74
75- debugger is now able to rewrite the whole traceback, not only the first
76 frame. (requires the optional debugger c module which is compiled
77 automatically on installation if possible)
78
79- if the set that is postfixed with a bang (!) it acts like the python 3
80 "nonlocal" keyword. This means that you can now override variables
81 defined in the outer scope from within a loop.
82
Armin Ronacher015b0c92007-11-11 00:10:17 +010083- ``foo ~ bar`` is now a simpler alternative to ``foo|string + bar|string``
Armin Ronacher1cc232c2007-09-07 17:52:41 +020084
85- `PackageLoader` can now work without pkg_resources too
86
87- added `getattribute` and `getitem` filter.
88
Armin Ronacher5f3f1362007-10-21 22:15:04 +020089- added support for the `pretty` library.
Armin Ronacherc6a36522007-10-21 21:38:35 +020090
Armin Ronacher77e2ab52007-10-22 23:31:48 +020091- changed the way the `MemcachedLoaderMixin` creates the class so that it's
92 possible to hook your own client in.
93
Armin Ronachera7804ef2007-06-15 18:03:21 +020094
Armin Ronachera22a53d2007-03-31 20:44:33 +020095Version 1.1
96-----------
Armin Ronacherecc051b2007-06-01 18:25:28 +020097(codename: sinka, released Jun 1, 2007)
Armin Ronachera22a53d2007-03-31 20:44:33 +020098
99- blocks now support ``{{ super() }}`` to render the parent output.
100
101- debugging system improved, smaller filesize for the cached files.
Armin Ronacher859efe02007-04-05 22:38:44 +0200102 Debugging works now well for any module using linecache.
Armin Ronachera22a53d2007-03-31 20:44:33 +0200103
Armin Ronacher90a5cb32007-04-15 00:56:32 +0200104- ``{{ debug() }}`` can now be used to get a list of filters and
105 tags.
106
Armin Ronacher21580912007-04-17 17:13:10 +0200107- the template lexer keeps not track of brace, parenthesis and
108 bracket balance in order to not break variable tags apart if they
109 are configured to look like this: ``${expr}``. This also fixes
110 the problem with nested dicts in variable expressions.
111
Armin Ronacher33d528a2007-05-14 18:21:44 +0200112- it's now possible to configure the variable blocks to look the
113 same as the block delimiters. Thus you can set the syntax to something
114 like ``{ / }`` for both blocks and variables.
115
Armin Ronachera22a53d2007-03-31 20:44:33 +0200116- added whitespace management system for the template designer.
117
118- some small bugfixes.
119
Armin Ronacheree2c18e2007-04-20 22:39:04 +0200120- improved security system regarding function calls and variable
121 assignment in for loops.
Armin Ronachera22a53d2007-03-31 20:44:33 +0200122
Armin Ronacher5a8e4972007-04-05 11:21:38 +0200123- added `lipsum` function to generate random text.
Armin Ronachera22a53d2007-03-31 20:44:33 +0200124
125- strings without unicode characters are processed as binary strings now
126 to workaround problems with `datetime.strftime` which only accepts
127 binary strings.
128
Armin Ronacher21580912007-04-17 17:13:10 +0200129- it's now possible to use newlines in string literals
130
Armin Ronacher40cf47c2007-04-04 13:50:09 +0200131- developer friendly traceback is now toggleable
132
Armin Ronacherfb5bebc2007-04-27 18:24:19 +0200133- the variable failure is now pluggable by replacing the undefined
134 singleton for an environment instance
Armin Ronacher40cf47c2007-04-04 13:50:09 +0200135
Armin Ronacher5a8e4972007-04-05 11:21:38 +0200136- fixed issue with old-style classes not implementing `__getitem__`
137 (thanks to Axel Böhm for discovering that bug)
138
139- added a bunch of new docstrings to the Jinja classes. Makes fun now to
140 use pydoc :-)
141
Armin Ronacher2acbac12007-04-11 21:49:48 +0200142- fixed severe memcaching bug. Formerly it wasn't possible to use memcaching
143 without enabling disk cache.
144
Armin Ronacherd071f952007-04-13 22:32:11 +0200145- fixed a bug that allowed users to override the special names `_`, `true` etc.
146
Armin Ronachereec31382007-04-14 14:50:45 +0200147- added `batch` and `slice` filters for batching or slicing sequences
148
Armin Ronacher9bcd4112007-05-29 14:17:24 +0200149- added `sum`, `abs`, `round` and `sort` filters. This fixes #238
Armin Ronacherd071f952007-04-13 22:32:11 +0200150
Armin Ronacher450756b2007-04-15 15:13:59 +0200151- added `striptags` and `xmlattr` filters for easier SGML/XML processing
Georg Brandlaf31e4d2007-04-15 00:47:37 +0200152
Armin Ronacher21580912007-04-17 17:13:10 +0200153- the trans tag does not need explicit naming for variables with the same
154 name any more. You can now use ``{% trans foo %}`` instead of the verbose
155 version ``{% trans foo=foo %}``.
156
157- reimplemented Buffet plugin so that it works at least for pylons
158
159- added `Environment.get_translations_for_string`
160
161- fixed a bug in the parser that didn't unescape keyword arguments. (thanks
162 to Alexey Melchakov for reporting)
163
Armin Ronacheree2c18e2007-04-20 22:39:04 +0200164- You can now use the environment to just tokenize a template. This can
165 be useful for syntax highlighting or other purposes.
166
Armin Ronacherfb5bebc2007-04-27 18:24:19 +0200167- added optional C-implementation of the context baseclass.
168
169- you can now use optional parentheses around macro defintions. Thus it's
170 possible to write ``{% macro foo(a, b, c) %}`` instead of ``{% macro
171 foo a, b, c %}``.
172
173- additional macro arguments now end up in `varargs`.
Armin Ronachere98c5f52007-04-21 09:39:06 +0200174
Armin Ronacherccf284b2007-05-21 16:44:26 +0200175- implemented the `{% call %}` block. `call` and `endcall` can still be used
176 as identifiers until Jinja 1.3
Armin Ronachere98c5f52007-04-21 09:39:06 +0200177
Armin Ronacher2f43ba42007-06-02 14:11:35 +0200178- it's now possible to stream templates.
Armin Ronacherfb5bebc2007-04-27 18:24:19 +0200179
Armin Ronacher4f417112007-04-28 23:23:44 +0200180- fixed a corner case when defining a block inside of a condition
181
Armin Ronacherce513f22007-04-29 19:56:52 +0200182- the cached loader mixin is now able to cache multiple templates from
183 different loaders in the same cache folder.
184
185- Translatable strings returned by ``_()`` will leave their string formatting
186 signs untouched. Thanks to Stefan Ebner for reporting.
187
Armin Ronacher49659872007-05-12 23:29:33 +0200188- ``{% block name "data" %}`` is now an alias for
189 ``{% block name %}data{% endblock %}``. Note that the second argument can
190 be an expression. As soon as you specify an expression as second argument
191 the closing tag has to be omitted.
192
Armin Ronacher6dba4d62007-05-21 23:41:36 +0200193- It's now possible to iterate over iterators additionally to sequences.
194 If the iterator is inifite it will crash however, so makes sure you don't
195 pass something like that to a template!
196
Armin Ronacher9bcd4112007-05-29 14:17:24 +0200197- added `rendetemplate` to render included templates in an isolated
198 environment and get the outout back.
199
200- added `simplefilter` decorator.
201
Armin Ronacher63ca7212007-05-30 00:29:39 +0200202- improved ChoiceLoader error reporting (thanks to Bryan McLemore)
203
Armin Ronacherecc051b2007-06-01 18:25:28 +0200204- fixed extended slicing
205
Armin Ronacherdb69d0a2007-06-02 01:35:53 +0200206- reworked loader layer. All the cached loaders now have "private" non cached
207 baseclasses so that you can easily mix your own caching layers in.
208
209- added `MemcachedLoaderMixin` and `MemcachedFileSystemLoader` contributed
210 by Bryan McLemore.
211
Armin Ronachera22a53d2007-03-31 20:44:33 +0200212
213Version 1.0
214-----------
Armin Ronacherecc051b2007-06-01 18:25:28 +0200215(codename: siyutusan, released Mar 23, 2007)
Armin Ronachera22a53d2007-03-31 20:44:33 +0200216
217- Initial release