view examples/basic/layout.kid @ 190:f0b32f1c478c

Improvements for the `py:with` directive: * One assignment in the same directive can now refer to an earlier assignment. * Semicolons used in string literals inside the expression are no longer treated as statement separators, and they don't need to be escaped then either. * Trailing semicolons are now ignored Many thanks to Oliver Cope for reporting these problems, and providing unit tests and a patch!
author cmlenz
date Wed, 23 Aug 2006 14:33:37 +0000
parents 24d98edcb808
children
line wrap: on
line source
<div xmlns:py="http://purl.org/kid/ns#" py:strip="">
  <head>
    <title>Hello ${hello}</title>
    <style type="text/css">@import(style.css)</style>
  </head>
  <div py:def="macro1">reference me, please</div>
  <div py:def="macro2(name, classname='expanded')" class="${classname}">
    Hello ${name.title()}
  </div>
  <span py:match="item.tag == '{http://www.w3.org/1999/xhtml}greeting'" class="greeting">
    Hello ${item.get('name')}
  </span>
  <span py:match="item.tag == '{http://www.w3.org/1999/xhtml}span' and item.get('class') == 'greeting'"
        py:content="item.text" style="text-decoration: underline" />
</div>
Copyright (C) 2012-2017 Edgewall Software