Mercurial > genshi > mirror
annotate examples/bench/kid/base.kid @ 744:cd6624cf2f7c trunk
Lots of `Transformer` cleanup:
- Content-insertion transformations (before, after, etc.) now accept a callable.
- `.prepend()` now ''only'' operates on elements. Previously it also operated on `OUTSIDE` marked events.
- Where it makes sense, transformations are now ''consistently'' applied to individually selected objects in the document, rather than on any contiguous selection. This means that adjacent selected elements will be treated individually rather than as a whole.
- Transformations should now consistently work on the context node.
- `.substitute()` now defaults to a count of 0 (ie. all) rather than 1. This is to be consistent with Python's regex substitution.
- `ATTR` events now have a `kind` of `ATTR` in addition to having this as their `mark`.
- Added the `BREAK` `mark`. This allows cuts of otherwise seamlessly joined objects to be operated on.
- Added a full test suite.
author | athomas |
---|---|
date | Mon, 09 Jun 2008 06:39:46 +0000 |
parents | c40a5dcd2b55 |
children |
rev | line source |
---|---|
57
300b6a3b0730
Add some simple benchmarks to compare performance against Clearsilver, Kid, Cheetah, and more soon.
cmlenz
parents:
diff
changeset
|
1 <html xmlns="http://www.w3.org/1999/xhtml" |
300b6a3b0730
Add some simple benchmarks to compare performance against Clearsilver, Kid, Cheetah, and more soon.
cmlenz
parents:
diff
changeset
|
2 xmlns:py="http://purl.org/kid/ns#"> |
69 | 3 |
4 <p py:def="greeting(name)"> | |
5 Hello, ${name}! | |
6 </p> | |
7 | |
8 <body py:match="item.tag == '{http://www.w3.org/1999/xhtml}body'" py:strip=""> | |
9 <div id="header"> | |
10 <h1>${title}</h1> | |
11 </div> | |
12 ${item} | |
13 <div id="footer" /> | |
14 </body> | |
57
300b6a3b0730
Add some simple benchmarks to compare performance against Clearsilver, Kid, Cheetah, and more soon.
cmlenz
parents:
diff
changeset
|
15 </html> |