Skip to content

Commit 8cf1d12

Browse files
committed
templates
1 parent ca270f5 commit 8cf1d12

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

docs/scenarios/web.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,11 @@ dynamic content to the template engine, and to the templates themselves.
270270

271271
Jinja2
272272
------
273-
`Jinja2 <http://jinja.pocoo.org/>`_ is a template engine which is similar to
274-
the Django template system with some extra features. It is a text-based
275-
template language and thus can be used to generate any markup. It allows
276-
customization of filters, tags, tests and globals, and unlike the template
277-
system implemented in the Django Framework, also allows calling functions.
278-
Jinja2 is released under the BSD license.
273+
`Jinja2 <http://jinja.pocoo.org/>`_ is a very well-regarded template engine.
274+
275+
It uses a text-based template language and can thus be used to generate any
276+
type markup, not just HTML. It allows customization of filters, tags, tests
277+
and globals. It features many improvements over Django's templating system.
279278

280279
Here some important html tags in Jinja2:
281280

@@ -297,7 +296,6 @@ Here some important html tags in Jinja2:
297296
{% endfor %}
298297

299298

300-
301299
The next listings is an example of a web site in combination with the Tornado
302300
web server. Tornado is not very complicated to use.
303301

@@ -385,8 +383,12 @@ into the corresponding block in the :file:`base.html` page.
385383
</p>
386384
{% endblock %}
387385

386+
387+
Jinja2 is the recommended templating library for new Python web applications.
388+
388389
Chameleon
389390
---------
391+
390392
`Chameleon <https://chameleon.readthedocs.org/>`_ Page Templates are an HTML/XML template
391393
engine implementation of the `Template Attribute Language (TAL) <http://en.wikipedia.org/wiki/Template_Attribute_Language>`_,
392394
`TAL Expression Syntax (TALES) <http://chameleon.readthedocs.org/en/latest/reference.html#expressions-tales>`_,
@@ -445,8 +447,11 @@ you can replace it with a more terse and readable syntax that uses the pattern
445447
But keep in mind that the full `<span tal:replace="expression">Default Text</span>`
446448
syntax also allows for default content in the unrendered template.
447449

450+
Being from the Pyramid world, Chameleon is not widely used.
451+
448452
Mako
449453
----
454+
450455
`Mako <http://www.makotemplates.org/>`_ is a template language that compiles to Python
451456
for maximum performance. Its syntax and api is borrowed from the best parts of other
452457
templating languages like Django and Jinja2 templates. It is the default template
@@ -482,6 +487,8 @@ To render a very basic template, you can do the following:
482487
from mako.template import Template
483488
print(Template("hello ${data}!").render(data="world"))
484489
490+
Mako is well respected within the Python web community.
491+
485492
.. rubric:: References
486493

487494
.. [1] `The mod_python project is now officially dead <http://blog.dscpl.com.au/2010/06/modpython-project-is-now-officially.html>`_

0 commit comments

Comments
 (0)