[Checkins] SVN: z3c.pt/trunk/docs/ Refimpls; tal:default-expression

Chris McDonough chrism at plope.com
Tue Aug 12 22:49:13 EDT 2008


Log message for revision 89774:
  Refimpls; tal:default-expression
  
  

Changed:
  U   z3c.pt/trunk/docs/index.rst
  A   z3c.pt/trunk/docs/narr/refimpls.rst
  U   z3c.pt/trunk/docs/narr/tal.rst

-=-
Modified: z3c.pt/trunk/docs/index.rst
===================================================================
--- z3c.pt/trunk/docs/index.rst	2008-08-13 01:54:11 UTC (rev 89773)
+++ z3c.pt/trunk/docs/index.rst	2008-08-13 02:49:13 UTC (rev 89774)
@@ -31,6 +31,7 @@
 .. toctree::
    :maxdepth: 2
 
+   narr/refimpls
    narr/tal
    narr/tales
    narr/metal
@@ -52,7 +53,8 @@
 To report bugs, use the `bug tracker <http://code.google.com/p/z3c-pt>`_.
 
 If you've got questions that aren't answered by this documentation,
-contact the `maillist <http://groups.google.com/group/z3c_pt>`_ ,
+please contact the `maillist
+<http://groups.google.com/group/z3c_pt>`_.
 
 Browse and check out tagged and trunk versions of :mod:`z3c.pt`
 via the `Subversion repository <http://svn.zope.org/z3c.pt/>`_.  To

Added: z3c.pt/trunk/docs/narr/refimpls.rst
===================================================================
--- z3c.pt/trunk/docs/narr/refimpls.rst	                        (rev 0)
+++ z3c.pt/trunk/docs/narr/refimpls.rst	2008-08-13 02:49:13 UTC (rev 89774)
@@ -0,0 +1,48 @@
+.. _reflimpl_chapter:
+
+Relationships to Reference Implementations
+==========================================
+
+:mod:`zc3.pt` implements both TAL and Genshi syntax.
+
+The :mod:`z3c.pt` compiler is largely compatible with the targeted
+dialects. The TAL implementation is based on the `1.4 language
+specification <http://wiki.zope.org/ZPT/TALSpecification14>`_ while
+the Genshi implementation is based on the documents for the `0.5
+release <http://genshi.edgewall.org/wiki/Documentation/xml-templates.html>`_.
+
+Notable Differences from TAL 1.4
+--------------------------------
+
+#. Tuple unpacking is allowed when using ``tal:define`` to define
+   variables:
+
+      ``tal:define="(a, b, c) [1, 2, 3]"``
+
+#. Generators are allowed in ``tal:repeat`` statements. Note that the
+   repeat variable is not available in this case
+
+      ``tal:repeat="i <some generator>"``
+
+#. Attribute-access to dictionary entries is allowed in
+   Python-expressions, e.g.
+
+      ``dictionary.key``
+
+   can be used instead of ``dictionary['key']``.
+
+#. The default expression type for a template can be set using the
+   ``tal:default-expression`` attribute on an element.  This is an
+   alternative to providing the expression type before each
+   expression.
+
+#. The ``global`` modifier for ``tal:define`` is not implemented.
+
+#. The ``tal:on-error`` statement is not implemented.
+
+Notable Differences from Genshi 0.5
+-----------------------------------
+
+#. The XPath select function provided to py:match-elements requires
+   lxml and requires the use of the default namespace prefix "xmlns".
+


Property changes on: z3c.pt/trunk/docs/narr/refimpls.rst
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: z3c.pt/trunk/docs/narr/tal.rst
===================================================================
--- z3c.pt/trunk/docs/narr/tal.rst	2008-08-13 01:54:11 UTC (rev 89773)
+++ z3c.pt/trunk/docs/narr/tal.rst	2008-08-13 02:49:13 UTC (rev 89774)
@@ -81,6 +81,9 @@
 - ``tal:replace`` - replace the content of an element and remove the
   element leaving the content.
 
+- ``tal:default-expression`` - set the default expression type for a
+  block of tags.
+
 .. warning:: The reference implementation of ZPT has an additonal command
    ``tal:on-error`` which :mod:`z3c.pt` does not implement.
 
@@ -261,11 +264,6 @@
         <p tal:content="structure context.getStory()">marked <b>up</b>
         content goes here.</p>
 
-See Also
-~~~~~~~~
-
-``tal:replace``
-
 ``tal:define``: Define variables
 --------------------------------
 
@@ -536,7 +534,28 @@
 
         <div tal:replace="nothing">This element is a comment.</div>
 
-See Also
+``tal:default-expression``: Set the default expression type for a block
+-----------------------------------------------------------------------
 
-      ``tal:content``
+Syntax
+~~~~~~
 
+``tal:default-expression`` syntax::
+
+        argument ::= expression-type
+
+Description
+~~~~~~~~~~~
+
+The ``tal:default-expression`` statement sets the default expression
+type within a logical block of tags.  If this tag is not used anywhere
+in the document, the default expression type is always ``python``.
+
+Examples
+~~~~~~~~
+
+Setting the default expression type to ``path`` within a block::
+
+        <div tal:default-expression="path">
+           <span tal:content="template/title">Title</span>
+        </div>



More information about the Checkins mailing list