Source: jinja2 Version: 2.6-1 Severity: minor Tags: patch
The attached patch fixes a bunch of typos in the documentation. -- Jakub Wilk
diff --git a/docs/api.rst b/docs/api.rst --- a/docs/api.rst +++ b/docs/api.rst @@ -450,7 +450,7 @@ the first request and Jinja compiles many templates at once which slows down the application. -To use a bytecode cache, instanciate it and pass it to the :class:`Environment`. +To use a bytecode cache, instantiate it and pass it to the :class:`Environment`. .. autoclass:: jinja2.BytecodeCache :members: load_bytecode, dump_bytecode, clear @@ -618,7 +618,7 @@ ------------------ The evaluation context (short eval context or eval ctx) is a new object -introducted in Jinja 2.4 that makes it possible to activate and deactivate +introduced in Jinja 2.4 that makes it possible to activate and deactivate compiled features at runtime. Currently it is only used to enable and disable the automatic escaping but diff --git a/docs/extensions.rst b/docs/extensions.rst --- a/docs/extensions.rst +++ b/docs/extensions.rst @@ -34,7 +34,7 @@ After enabling dummy `_` function that forwards calls to `gettext` is added to the environment globals. An internationalized application then has to -provide at least an `gettext` and optoinally a `ngettext` function into the +provide at least an `gettext` and optionally a `ngettext` function into the namespace. Either globally or for each rendering. Environment Methods @@ -213,13 +213,13 @@ .. module:: jinja2.ext -By writing extensions you can add custom tags to Jinja2. This is a non trival +By writing extensions you can add custom tags to Jinja2. This is a non-trivial task and usually not needed as the default tags and expressions cover all common use cases. The i18n extension is a good example of why extensions are useful, another one would be fragment caching. When writing extensions you have to keep in mind that you are working with the -Jinja2 template compiler which does not validate the node tree you are possing +Jinja2 template compiler which does not validate the node tree you are passing to it. If the AST is malformed you will get all kinds of compiler or runtime errors that are horrible to debug. Always make sure you are using the nodes you create correctly. The API documentation below shows which nodes exist and diff --git a/docs/sandbox.rst b/docs/sandbox.rst --- a/docs/sandbox.rst +++ b/docs/sandbox.rst @@ -42,7 +42,7 @@ are running multiple users on the same server) they can't harm each other via JavaScript insertions and much more. - Also the sandbox is only as good as the configuration. We stronly + Also the sandbox is only as good as the configuration. We strongly recommend only passing non-shared resources to the template and use some sort of whitelisting for attributes. @@ -54,7 +54,7 @@ .. versionadded:: 2.6 -For maximum performace Jinja2 will let operators call directly the type +For maximum performance Jinja2 will let operators call directly the type specific callback methods. This means that it's not possible to have this intercepted by overriding :meth:`Environment.call`. Furthermore a conversion from operator to special method is not always directly possible diff --git a/docs/templates.rst b/docs/templates.rst --- a/docs/templates.rst +++ b/docs/templates.rst @@ -433,7 +433,7 @@ manually escaping each variable or automatically escaping everything by default. Jinja supports both, but what is used depends on the application configuration. -The default configuaration is no automatic escaping for various reasons: +The default configuration is no automatic escaping for various reasons: - escaping everything except of safe values will also mean that Jinja is escaping variables known to not include HTML such as numbers which is @@ -805,7 +805,7 @@ different templates and get imported from there. This works similar to the import statements in Python. It's important to know that imports are cached and imported templates don't have access to the current template variables, -just the globals by defualt. For more details about context behavior of +just the globals by default. For more details about context behavior of imports and includes see :ref:`import-visibility`. There are two ways to import templates. You can import the complete template @@ -964,7 +964,7 @@ a look at the ``~`` operator. ``{{ 1 + 1 }}`` is ``2``. \- - Substract the second number from the first one. ``{{ 3 - 2 }}`` is ``1``. + Subtract the second number from the first one. ``{{ 3 - 2 }}`` is ``1``. / Divide two numbers. The return value will be a floating point number. @@ -1180,7 +1180,7 @@ .. class:: joiner(sep=', ') A tiny helper that can be use to "join" multiple sections. A joiner is - passed a string and will return that string every time it's calld, except + passed a string and will return that string every time it's called, except the first time in which situation it returns an empty string. You can use this to join things:: @@ -1276,7 +1276,7 @@ {{ gettext('Hello %(name)s!', name='World') }} {{ ngettext('%(num)d apple', '%(num)d apples', apples|count) }} -Note that the `ngettext` function's format string automatically recieves +Note that the `ngettext` function's format string automatically receives the count as `num` parameter additionally to the regular parameters. @@ -1295,7 +1295,7 @@ If the application enables the :ref:`loopcontrols-extension` it's possible to use `break` and `continue` in loops. When `break` is reached, the loop is -terminated, if `continue` is eached the processing is stopped and continues +terminated, if `continue` is reached the processing is stopped and continues with the next iteration. Here a loop that skips every second item:: diff --git a/docs/tricks.rst b/docs/tricks.rst --- a/docs/tricks.rst +++ b/docs/tricks.rst @@ -15,7 +15,7 @@ Jinja2 supports dynamic inheritance and does not distinguish between parent and child template as long as no `extends` tag is visited. While this leads to the surprising behavior that everything before the first `extends` tag -including whitespace is printed out instead of being igored, it can be used +including whitespace is printed out instead of being ignored, it can be used for a neat trick. Usually child templates extend from one template that adds a basic HTML