Mercurial > genshi > mirror
diff doc/filters.txt @ 519:9e11fa7f4603 trunk
Cut and copy transformer operations can now operate on selected attributes.
Also added an example of inserting content to the documentation.
author | athomas |
---|---|
date | Thu, 07 Jun 2007 18:03:02 +0000 |
parents | 1bdccd3bda00 |
children | 4d486f15c986 |
line wrap: on
line diff
--- a/doc/filters.txt +++ b/doc/filters.txt @@ -164,12 +164,14 @@ ... </body> ... </html>''') - >>> print html | Transformer('body//em').apply(unicode.upper, TEXT) \ - ... .unwrap().wrap(tag.u) + >>> print html | Transformer('body/em').apply(unicode.upper, TEXT) \ + ... .unwrap().wrap(tag.u).end() \ + ... .select('body/u') \ + ... .prepend('underlined ') <html> <head><title>Some Title</title></head> <body> - Some <u>BODY</u> text. + Some <u>underlined BODY</u> text. </body> </html> @@ -177,8 +179,9 @@ 1. matches any `<em>` element anywhere in the body, 2. uppercases any text nodes in the element, - 3. strips off the `<em>` start and close tags, and - 4. wraps the content in a `<u>` tag. + 3. strips off the `<em>` start and close tags, + 4. wraps the content in a `<u>` tag, and + 5. inserts the text `underlind` inside the `<u>` tag. A number of commonly useful transformations are available for this filter. Please consult the API documentation a complete list.