Mercurial > genshi > mirror
comparison doc/builder.txt @ 382:2682dabbcd04 trunk
* Added documentation for the various stream event kinds.
* Move generation of HTML documentation into a custom distutils command, run by `setup.py build_doc`
* Added verification of doctest snippets in documentation, which can be run by `setup.py test_doc`
* Fixed `repr` of `Markup` instances.
author | cmlenz |
---|---|
date | Fri, 01 Dec 2006 23:43:59 +0000 |
parents | 41107d1ba1c8 |
children |
comparison
equal
deleted
inserted
replaced
381:b9fc7a1f76ca | 382:2682dabbcd04 |
---|---|
50 shortcut for converting the ``Element`` to a stream and serializing that | 50 shortcut for converting the ``Element`` to a stream and serializing that |
51 stream:: | 51 stream:: |
52 | 52 |
53 >>> stream = doc.generate() | 53 >>> stream = doc.generate() |
54 >>> stream | 54 >>> stream |
55 <genshi.core.Stream object at 0x72d230> | 55 <genshi.core.Stream object at ...> |
56 >>> print stream | 56 >>> print stream |
57 <p class="intro">Some text and <a href="http://example.org/">a link</a>.<br/></p> | 57 <p class="intro">Some text and <a href="http://example.org/">a link</a>.<br/></p> |
58 | 58 |
59 | 59 |
60 Creating Fragments | 60 Creating Fragments |
63 The ``tag`` object also allows creating “fragments”, which are basically lists | 63 The ``tag`` object also allows creating “fragments”, which are basically lists |
64 of nodes (elements or text) that don't have a parent element. This can be useful | 64 of nodes (elements or text) that don't have a parent element. This can be useful |
65 for creating snippets of markup that are attached to a parent element later (for | 65 for creating snippets of markup that are attached to a parent element later (for |
66 example in a template). Fragments are created by calling the ``tag`` object:: | 66 example in a template). Fragments are created by calling the ``tag`` object:: |
67 | 67 |
68 >>> fragment = tag('Hello, ', tag.em('word'), '!') | 68 >>> fragment = tag('Hello, ', tag.em('world'), '!') |
69 >>> fragment | 69 >>> fragment |
70 <Fragment> | 70 <Fragment> |
71 >>> print fragment | 71 >>> print fragment |
72 Hello, <em>world</em>! | 72 Hello, <em>world</em>! |