Skip to content
Myr

fix a bunch of typos in the documentation

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

authored by Jakub Wilk · committed by Piotr Ożarowski · parent 073fdc0 · Browse files · 6 files+8 added−8 removed
This commit

State

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

Diff stats

6 files+8 added−8 removed

  • other:+8 added−8 removed

6 files+8 added−8 removed

modified:docs/api.rst+2 added-2 removed
448 unmodified lines
449This is especially useful if you have a web application that is initialized on450the first request and Jinja compiles many templates at once which slows down451the application.452453To use a bytecode cache, instanciate it and pass it to the :class:`Environment`.453To use a bytecode cache, instantiate it and pass it to the :class:`Environment`.454455.. autoclass:: jinja2.BytecodeCache456 :members: load_bytecode, dump_bytecode, clear457
159 unmodified lines
617Evaluation Context618------------------619620The evaluation context (short eval context or eval ctx) is a new object621introducted in Jinja 2.4 that makes it possible to activate and deactivate621introduced in Jinja 2.4 that makes it possible to activate and deactivate622compiled features at runtime.623624Currently it is only used to enable and disable the automatic escaping but625can 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.
550 unmodified lines
1032 the preferred way to concatenate strings! For string concatenation have1033 a look at the ``~`` operator. ``{{ 1 + 1 }}`` is ``2``.10341035\-1036 Substract the second number from the first one. ``{{ 3 - 2 }}`` is ``1``.1036 Subtract the second number from the first one. ``{{ 3 - 2 }}`` is ``1``.10371038/1039 Divide two numbers. The return value will be a floating point number.1040 ``{{ 1 / 2 }}`` is ``{{ 0.5 }}``.
395 unmodified lines
modified:docs/tricks.rst+1 added-1 removed
13 unmodified lines
1415Jinja2 supports dynamic inheritance and does not distinguish between parent16and child template as long as no `extends` tag is visited. While this leads17to the surprising behavior that everything before the first `extends` tag18including whitespace is printed out instead of being igored, it can be used18including whitespace is printed out instead of being ignored, it can be used19for a neat trick.2021Usually child templates extend from one template that adds a basic HTML22skeleton. However it's possible put the `extends` tag into an `if` tag to
78 unmodified lines
modified:jinja2/nodes.py+1 added-1 removed
741 unmodified lines
742 operator = '+'743744745class Sub(BinExpr):746 """Substract the right from the left node."""746 """Subtract the right from the left node."""747 operator = '-'748749750class Mod(BinExpr):
161 unmodified lines