# HG changeset patch # User Aurelien Campeas # Date 1496140362 -7200 # Tue May 30 12:32:42 2017 +0200 # Node ID 742d613ca5f016f98eb7bcc598f0673dcb118483 # Parent b4655d7d9fdbdcdafbdedafe7c8743b9c33a0549 pythml/doc: prefer py3k style prints, add quick-changelog entry for the html-> pyhtml transition diff --git a/html.py b/pyhtml.py rename from html.py rename to pyhtml.py --- a/html.py +++ b/pyhtml.py @@ -1,5 +1,4 @@ # -*- encoding: utf-8 -*- -# '''Simple, elegant HTML, XHTML and XML generation. Constructing your HTML @@ -11,14 +10,14 @@ >>> from html import HTML >>> h = HTML() >>> h.p('Hello, world!') ->>> print h # or print(h) in python 3+ +>>> print(h)

Hello, world!

You may supply a tag name and some text contents when creating a HTML instance: >>> h = HTML('html', 'text') ->>> print h +>>> print(h) text You may also append text content later using the tag's ``.text()`` method @@ -32,7 +31,7 @@ >>> p.text('more → text', escape=False) >>> p += ' ... augmented' >>> h.p ->>> print h +>>> print(h)

hello, world!
more → text ... augmented

@@ -46,7 +45,7 @@ >>> l = h.ol >>> l.li('item 1') >>> l.li.b('item 2 > 1') ->>> print h +>>> print(h)

  1. item 1
  2. item 2 > 1
  3. @@ -63,7 +62,7 @@ >>> r = t.tr >>> r.td('column 1') >>> r.td('column 2') ->>> print t +>>> print(t) @@ -83,13 +82,13 @@ >>> l = h.ol(newlines=False) >>> l.li('item 1') >>> l.li('item 2') ->>> print h +>>> print(h)
    1. item 1
    2. item 2
    Since we can't use ``class`` as a keyword, the library recognises ``klass`` as a substitute: ->>> print h.p(content, klass="styled") +>>> print(h.p(content, klass="styled"))

    content

    @@ -148,7 +147,7 @@ >>> h = XHTML() >>> h.p >>> h.br ->>> print h +>>> print(h)


    @@ -163,7 +162,7 @@ >>> h = XML('xml') >>> h.p >>> h.br('hi there') ->>> print h +>>> print(h)


    hi there
    @@ -180,7 +179,7 @@ >>> h = XML('xml') >>> h += XML('some-tag', 'some text') >>> h += XML('text', 'some text') ->>> print h +>>> print(h) some text some text @@ -190,6 +189,8 @@ Version History (in Brief) -------------------------- +- 1.17 repackage it as "pyhtml" since "html" clashes with the + homonymous py3 stdlib module - 1.16 detect and raise a more useful error when some WSGI frameworks attempt to call HTML.read(). Also added ability to add new content using the += operator. @@ -219,6 +220,7 @@ This code is copyright 2009-2011 eKit.com Inc (http://www.ekit.com/) See the end of the source file for the license of use. XHTML support was contributed by Michael Haubenwallner. + ''' import cgi

    column 1column 2
    column 1column 2