Metadata-Version: 1.0
Name: html
Version: 1.1
Summary: simple, elegant HTML generation
Home-page: UNKNOWN
Author: Richard Jones
Author-email: rjones@ekit-inc.com
License: UNKNOWN
Description: 
        Simple, elegant HTML generation
        -------------------------------
        
        To construct HTML start with an instance of ``html.HTML()``. Add
        tags by accessing the tag's attribute on that object. For example::
        
        >>> from html import HTML
        >>> h = HTML()
        >>> h.br
        >>> print h
        <br>
        
        If the tag should have text content you may pass it at tag creation time or
        later using the tag's ``.text()`` method (note it is assumed that a fresh
        ``HTML`` instance is created for each of the following examples)::
        
        >>> p = h.p('hello world!\n')
        >>> p.text('more &rarr; text', escape=False)
        >>> h.p
        >>> print h
        <p>hello, world!
        more &rarr; text</p>
        <p>
        
        Any HTML-specific characters (``<>&"``) in the text will be escaped for HTML
        safety as appropriate unless ``escape=False`` is passed. Note also that the
        top-level ``HTML`` object adds newlines between tags by default.
        
        If the tag should have sub-tags you have two options. You may either add
        the sub-tags directly on the tag::
        
        >>> l = h.ol
        >>> l.li('item 1')
        >>> l.li.b('item 2 > 1')
        >>> print h
        <ol>
        <li>item 1</li>
        <li><b>item 2 &gt; 1</b></li>
        </ol>
        
        Note that the default behavior with lists (and tables) is to add newlines
        between sub-tags to generate a nicer output.
        
        The alternative to the above method is to use the containter tag as a
        context for adding the sub-tags. The top-level ``HTML`` object keeps track
        of which tag is the current context::
        
        >>> with h.table(border='1'):
        ...   for i in range(2):
        ...     with h.tr:
        ...       h.td('column 1')
        ...       h.td('column 2')
        ...  print h
        <table border="1">
        <tr><td>column 1</td><td>column 2</td></tr>
        <tr><td>column 1</td><td>column 2</td></tr>
        </table>
        
        Note the addition of an attribute to the ``<table>`` tag.
        
        A variation on the above is to explicitly reference the context variable,
        but then there's really no benefit to using a ``with`` statement. The
        following is functionally identical to the first list construction::
        
        >>> with h.ol as l:
        ...   l.li('item 1')
        ...   l.li.b('item 2 > 1')
        
        You may turn off/on adding newlines by passing ``newlines=False`` or
        ``True`` to the tag (or ``HTML`` instance) at creation time::
        
        >>> l = h.ol(newlines=False)
        >>> l.li('item 1')
        >>> l.li('item 2')
        >>> print h
        <ol><li>item 1</li><li>item 2</li></ol>
        
        ----
        
        This code is copyright 2009 eKit.com Inc (http://www.ekit.com/)
        See the end of the source file for the license of use.
        
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 2.6
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup :: HTML
Classifier: License :: OSI Approved :: BSD License
