diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst index 026ac71..f793295 100644 --- a/docs/scenarios/web.rst +++ b/docs/scenarios/web.rst @@ -414,6 +414,65 @@ into the corresponding block in the :file:`base.html` page.

{% endblock %} +Chameleon +--------- +`Chameleon `_ Page Templates are an HTML/XML template +engine implementation of the `Template Attribute Language (TAL) `_, +`TAL Expression Syntax (TALES) `_, +and `Macro Expansion TAL (Metal) ` syntaxes. + +Chameleon is available for Python 2.5 and up (including 3.x and pypy), and +is commonly used by the `Pyramid Framework `_. + +Page Templates add within your document structure special element attributes +and text markup. Using a set of simple language constructs, you control the +document flow, element repetition, text replacement and translation. Because +of the attribute-based syntax, unrendered page templates are valid HTML and can +be viewed in a browser and even edited in WYSIWYG editors. This can make +round-trip collaboration with designers and prototyping with static files in a +browser easier. + +The basic TAL language is simple enough to grasp from an example: + +.. code-block:: html + + + +

Hello, World!

+ + + + +
+ +
+ + + + +The `` pattern for text insertion is common +enough that if you do not require strict validity in your unrendered templates, +you can replace it with a more terse and readable syntax that uses the pattern +`${expression}`, as follows: + +.. code-block:: html + + + +

Hello, ${world}!

+ + + + +
+ ${row.capitalize()} ${col} +
+ + + + +But keep in mind that the full `Default Text` +syntax also allows for default content in the unrendered template. .. rubric:: References