Changeset 5322:23a99cbbf7f8 in livinglogic.python.xist for docs/UL4.rst

Show
Ignore:
Timestamp:
02/08/13 18:45:13 (7 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Rename <?exe?> back to <?code?>.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/UL4.rst

    r5318 r5322  
    362362 
    363363 
    364 ``exe`` 
    365 ------- 
    366  
    367 The ``exe`` tag can contain statements that define or modify variables or 
     364``code`` 
     365-------- 
     366 
     367The ``code`` tag can contain statements that define or modify variables or 
    368368expressions which will be evaluated for their side effects. Apart from the 
    369369assigment operator ``=``, the following augmented assignment operators are 
     
    381381For example the following template will output ``40``:: 
    382382 
    383     <?exe x = 17?> 
    384     <?exe x += 23?> 
     383    <?code x = 17?> 
     384    <?code x += 23?> 
    385385    <?print x?> 
    386386 
     
    397397template:: 
    398398 
    399     <?exe quote.render(text="foo")?> 
    400  
    401 (Here an ``<?exe?>`` tag is used. The expression in the ``<?exe?>`` tag is 
     399    <?code quote.render(text="foo")?> 
     400 
     401(Here an ``<?code?>`` tag is used. The expression in the ``<?code?>`` tag is 
    402402evaluated for the side effect of generating output) 
    403403 
     
    418418example will output ``1``:: 
    419419 
    420     <?exe i = 1?> 
     420    <?code i = 1?> 
    421421    <?template x?> 
    422422        <?print i?> 
    423423    <?end template?> 
    424     <?exe i = 2?> 
     424    <?code i = 2?> 
    425425    <?render x.render()?> 
    426426 
     
    506506expressions:: 
    507507 
    508     <?exe ge = ("(" + c + ")" for c in "gurk")?> 
     508    <?code ge = ("(" + c + ")" for c in "gurk")?> 
    509509    <?print ", ".join(ge)?> 
    510510 
     
    11631163``**`` syntax:: 
    11641164 
    1165     <?exe output = template.renders(a=17, b=23)?> 
    1166     <?exe data = {'a': 17, 'b': 23)?> 
    1167     <?exe output = template.renders(**data)?> 
     1165    <?code output = template.renders(a=17, b=23)?> 
     1166    <?code data = {'a': 17, 'b': 23)?> 
     1167    <?code output = template.renders(**data)?> 
    11681168 
    11691169 
     
    12011201above (except for the linefeeds of course):: 
    12021202 
    1203     <?exe weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']?> 
    1204     <?exe months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']?> 
    1205     <?exe t = @(2010-02-22T17:38:40.123456)?> 
     1203    <?code weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']?> 
     1204    <?code months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']?> 
     1205    <?code t = @(2010-02-22T17:38:40.123456)?> 
    12061206    <?print weekdays[t.weekday()]?>, 
    12071207    <?print format(t.day(), '02')?>