From: Markus Unterwaditzer Date: Wed, 11 Mar 2015 20:16:25 +0000 (+0100) Subject: Merge pull request #395 from esonderegger/master X-Git-Tag: 2.8~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb4b897bc36bfd6dd38fca28cf48fcbce6e67ef9;p=thirdparty%2Fjinja.git Merge pull request #395 from esonderegger/master Updated template documentation examples --- cb4b897bc36bfd6dd38fca28cf48fcbce6e67ef9 diff --cc docs/templates.rst index d4fa6b39,b154764f..d9102ecc --- a/docs/templates.rst +++ b/docs/templates.rst @@@ -13,19 -13,18 +13,19 @@@ behavior of undefined values Synopsis -------- -A template is simply a text file. It can generate any text-based format -(HTML, XML, CSV, LaTeX, etc.). It doesn't have a specific extension, -``.html`` or ``.xml`` are just fine. +A Jinja template is simply a text file. Jinja can generate any text-based +format (HTML, XML, CSV, LaTeX, etc.). A Jinja template doesn't need to have a +specific extension: ``.html``, ``.xml``, or any other extension is just fine. -A template contains **variables** or **expressions**, which get replaced with -values when the template is evaluated, and tags, which control the logic of -the template. The template syntax is heavily inspired by Django and Python. +A template contains **variables** and/or **expressions**, which get replaced +with values when a template is *rendered*; and **tags**, which control the +logic of the template. The template syntax is heavily inspired by Django and +Python. -Below is a minimal template that illustrates a few basics. We will cover -the details later in that document:: +Below is a minimal template that illustrates a few basics using the default +Jinja configuration. We will cover the details later in this document:: - + My Webpage @@@ -360,10 -338,11 +359,11 @@@ document that you might use for a simpl {% endblock %} + In this example, the ``{% block %}`` tags define four blocks that child templates -can fill in. All the `block` tag does is to tell the template engine that a -child template may override those portions of the template. +can fill in. All the `block` tag does is tell the template engine that a +child template may override those placeholders in the template. Child Template ~~~~~~~~~~~~~~