Merge pull request #293 from carldunham/docfix
Before adoption: this commit came in with the history the project adopted, so no landing records it.
fixed some typos and clarifying
authored by Armin Ronacher · committed by Armin Ronacher · parents 9ff7de9, d546358 · 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
Provenance
- Commit
6a04a8b- Tree
d19fa60- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
9ff7de9- Parent 2
d546358
5 files changed+12 added−14 removed
modified:docs/api.rst+1 added-1 removed
10 unmodified lines11 Basics12 ------13 14 Jinja2 uses a central object called the template :class:`Environment`.15-Instances of this class are used to store the configuration, global objects15+Instances of this class are used to store the configuration and global objects,16 and are used to load templates from the file system or other locations.17 Even if you are creating templates from strings by using the constructor of18 :class:`Template` class, an environment is created automatically for you,19 albeit a shared one.776 unmodified linesmodified:docs/index.rst+2 added-2 removed
1 Welcome to Jinja22 =================3 4-Jinja2 is a modern and designer friendly templating language for Python,4+Jinja2 is a modern and designer-friendly templating language for Python,5 modelled after Django's templates. It is fast, widely used and secure6 with the optional sandboxed template execution environment:7 8 .. sourcecode:: html+jinja10 unmodified lines19 - 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 linesmodified:docs/intro.rst+7 added-8 removed
15 unmodified lines16 3.2 you can use an older release of Jinja2 (2.6) as support for Python 3.217 was dropped in Jinja2 version 2.7.18 19 If you wish to use the :class:`~jinja2.PackageLoader` class, you will also20-need setuptools or distribute installed at runtime.20+need `setuptools`_ or `distribute`_ installed at runtime.21 22 Installation23 ------------24 25 You have multiple ways to install Jinja2. If you are unsure what to do, go26 with the Python egg or tarball.27 28-As a Python egg (via easy_install)29-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~28+As a Python egg (via `easy_install`)29+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~30 31 You can install the most recent Jinja2 version using `easy_install`_ or `pip`_::32 33 easy_install Jinja211 unmodified lines45 1. Download the most recent tarball from the `download page`_46 2. Unpack the tarball47 3. ``sudo python setup.py install``48 49-Note that you either have to have setuptools or `distribute`_ installed;49+Note that you either have to have `setuptools` or `distribute` installed;50 the latter is preferred.51 52 This will install Jinja2 into your Python installation's site-packages directory.53 54-.. _distribute: http://pypi.python.org/pypi/distribute55-54 Installing the development version55 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~56 57 1. Install `git`_1 unmodified line59 3. ``cd jinja2``60 4. ``ln -s jinja2 /usr/lib/python2.X/site-packages``61 62 As an alternative to steps 4 you can also do ``python setup.py develop``65-which will install the package via distribute in development mode. This also63+which will install the package via `distribute` in development mode. This also64 has the advantage that the C extensions are compiled.65 66 .. _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 lines115 there and behavior might be inconsistent. If you notice any bugs, please116 provide feedback in the `Jinja bug tracker`_.117 118 Also please keep in mind that the documentation is written with Python 2120-in mind, you will have to adapt the shown code examples to Python 3 syntax119+in mind, so you will have to adapt the shown code examples to Python 3 syntax120 for yourself.121 122 123 .. _Jinja bug tracker: http://github.com/mitsuhiko/jinja2/issuesmodified:jinja2/environment.py+1 added-1 removed
106 unmodified lines107 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.110 111- Here the possible initialization parameters:111+ Here are the possible initialization parameters:112 113 `block_start_string`114 The string marking the beginning of a block. Defaults to ``'{%'``.115 1088 unmodified linesmodified:jinja2/filters.py+1 added-2 removed
202 unmodified lines203 {% for item in mydict|dictsort(true) %}204 sort the dict by key, case sensitive205 206 {% 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':784 unmodified lines