Skip to content
Myr

fixed some typos and clarifying

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

authored by Carl A Dunham · committed by Carl A Dunham · parent 27ffd01 · Browse files · 5 files+12 added−14 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+12 added−14 removed

  • other:+12 added−14 removed

5 files+12 added−14 removed

modified:docs/api.rst+1 added-1 removed
10 unmodified lines
11Basics12------1314Jinja2 uses a central object called the template :class:`Environment`.15Instances of this class are used to store the configuration, global objects15Instances of this class are used to store the configuration and global objects,16and are used to load templates from the file system or other locations.17Even if you are creating templates from strings by using the constructor of18:class:`Template` class, an environment is created automatically for you,19albeit a shared one.
771 unmodified lines
modified:docs/index.rst+2 added-2 removed
1Welcome to Jinja22=================34Jinja2 is a modern and designer friendly templating language for Python,4Jinja2 is a modern and designer-friendly templating language for Python,5modelled after Django's templates. It is fast, widely used and secure6with the optional sandboxed template execution environment:78.. sourcecode:: html+jinja
10 unmodified lines
19- sandboxed execution20- powerful automatic HTML escaping system for XSS prevention21- template inheritance22- compiles down to the optimal python code just in time23- optional ahead of time template compilation23- optional ahead-of-time template compilation24- easy to debug. Line numbers of exceptions directly point to25 the correct line in the template.26- configurable syntax27
7 unmodified lines
modified:docs/intro.rst+7 added-8 removed
15 unmodified lines
163.2 you can use an older release of Jinja2 (2.6) as support for Python 3.217was dropped in Jinja2 version 2.7.1819If you wish to use the :class:`~jinja2.PackageLoader` class, you will also20need setuptools or distribute installed at runtime.20need `setuptools`_ or `distribute`_ installed at runtime.2122Installation23------------2425You have multiple ways to install Jinja2. If you are unsure what to do, go26with the Python egg or tarball.2728As a Python egg (via easy_install)29~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~28As a Python egg (via `easy_install`)29~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~3031You can install the most recent Jinja2 version using `easy_install`_ or `pip`_::3233 easy_install Jinja2
11 unmodified lines
451. Download the most recent tarball from the `download page`_462. Unpack the tarball473. ``sudo python setup.py install``4849Note that you either have to have setuptools or `distribute`_ installed;49Note that you either have to have `setuptools` or `distribute` installed;50the latter is preferred.5152This will install Jinja2 into your Python installation's site-packages directory.5354.. _distribute: http://pypi.python.org/pypi/distribute5554Installing the development version55~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~56571. Install `git`_
1 unmodified line
593. ``cd jinja2``604. ``ln -s jinja2 /usr/lib/python2.X/site-packages``6162As an alternative to steps 4 you can also do ``python setup.py develop``65which will install the package via distribute in development mode. This also63which will install the package via `distribute` in development mode. This also64has the advantage that the C extensions are compiled.6566.. _download page: http://pypi.python.org/pypi/Jinja267.. _distribute: http://pypi.python.org/pypi/distribute 68.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools69.. _easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall70.. _pip: http://pypi.python.org/pypi/pip71.. _git: http://git-scm.org/
43 unmodified lines
115there and behavior might be inconsistent. If you notice any bugs, please116provide feedback in the `Jinja bug tracker`_.117118Also please keep in mind that the documentation is written with Python 2120in mind, you will have to adapt the shown code examples to Python 3 syntax119in mind, so you will have to adapt the shown code examples to Python 3 syntax120for yourself.121122123.. _Jinja bug tracker: http://github.com/mitsuhiko/jinja2/issues
modified:jinja2/environment.py+1 added-1 removed
106 unmodified lines
107 they are not shared and if no template was loaded so far.108 Modifications on environments after the first template was loaded109 will lead to surprising effects and undefined behavior.110111 Here the possible initialization parameters:111 Here are the possible initialization parameters:112113 `block_start_string`114 The string marking the begin of a block. Defaults to ``'{%'``.115
1076 unmodified lines
modified:jinja2/filters.py+1 added-2 removed
202 unmodified lines
203 {% for item in mydict|dictsort(true) %}204 sort the dict by key, case sensitive205206 {% for item in mydict|dictsort(false, 'value') %}207 sort the dict by key, case insensitive, sorted208 normally and ordered by value.207 sort the dict by value, case insensitive208 """209 if by == 'key':210 pos = 0211 elif by == 'value':
788 unmodified lines