Skip to content
Myr

Merge pull request #230 from p1otr/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

documentation typos

authored by Armin Ronacher · committed by Armin Ronacher · parents ac168ca, 3fc008b · Browse files · 5 files+7 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+7 added−7 removed

  • other:+7 added−7 removed

5 files+7 added−7 removed

modified:docs/api.rst+2 added-2 removed
453 unmodified lines
454This is especially useful if you have a web application that is initialized on455the first request and Jinja compiles many templates at once which slows down456the application.457458To use a bytecode cache, instanciate it and pass it to the :class:`Environment`.458To use a bytecode cache, instantiate it and pass it to the :class:`Environment`.459460.. autoclass:: jinja2.BytecodeCache461 :members: load_bytecode, dump_bytecode, clear462
159 unmodified lines
622Evaluation Context623------------------624625The evaluation context (short eval context or eval ctx) is a new object626introducted in Jinja 2.4 that makes it possible to activate and deactivate626introduced in Jinja 2.4 that makes it possible to activate and deactivate627compiled features at runtime.628629Currently it is only used to enable and disable the automatic escaping but630can be used for extensions as well.
165 unmodified lines
modified:docs/extensions.rst+1 added-1 removed
211 unmodified lines
212------------------213214.. module:: jinja2.ext215216By writing extensions you can add custom tags to Jinja2. This is a non trival216By writing extensions you can add custom tags to Jinja2. This is a non-trivial217task and usually not needed as the default tags and expressions cover all218common use cases. The i18n extension is a good example of why extensions are219useful. Another one would be fragment caching.220
127 unmodified lines
modified:docs/sandbox.rst+1 added-1 removed
52 unmodified lines
53---------------------5455.. versionadded:: 2.65657For maximum performace Jinja2 will let operators call directly the type57For maximum performance Jinja2 will let operators call directly the type58specific callback methods. This means that it's not possible to have this59intercepted by overriding :meth:`Environment.call`. Furthermore a60conversion from operator to special method is not always directly possible61due to how operators work. For instance for divisions more than one
33 unmodified lines
modified:docs/templates.rst+2 added-2 removed
472 unmodified lines
473include characters that affect the resulting HTML. There are two approaches:474manually escaping each variable or automatically escaping everything by default.475476Jinja supports both, but what is used depends on the application configuration.477The default configuaration is no automatic escaping for various reasons:477The default configuration is no automatic escaping for various reasons:478479- escaping everything except of safe values will also mean that Jinja is480 escaping variables known to not include HTML such as numbers which is481 a huge performance hit.
571 unmodified lines
1053 the preferred way to concatenate strings! For string concatenation have1054 a look at the ``~`` operator. ``{{ 1 + 1 }}`` is ``2``.10551056\-1057 Substract the second number from the first one. ``{{ 3 - 2 }}`` is ``1``.1057 Subtract the second number from the first one. ``{{ 3 - 2 }}`` is ``1``.10581059/1060 Divide two numbers. The return value will be a floating point number.1061 ``{{ 1 / 2 }}`` is ``{{ 0.5 }}``.
395 unmodified lines
modified:jinja2/nodes.py+1 added-1 removed
749 unmodified lines
750 operator = '+'751752753class Sub(BinExpr):754 """Substract the right from the left node."""754 """Subtract the right from the left node."""755 operator = '-'756757758class Mod(BinExpr):
161 unmodified lines