HTMLgen docs, tutorial

Discussion in 'Python' started by user@domain.invalid, Oct 1, 2003.

  1. Guest

    Checking out HTMLgen, I find the manual
    to be quite terse, and difficult to crack.

    Are there any examples or tutorials available
    for this package?

    Thanks,

    Tobiah
    , Oct 1, 2003
    #1
    1. Advertising

  2. lid wrote:
    > Checking out HTMLgen, I find the manual
    > to be quite terse, and difficult to crack.
    >
    > Are there any examples or tutorials available
    > for this package?


    Its quite easy: if you have a HTML-tag with included text,
    just use the approriate class and pass the text as argument:

    <p>hallo</p> becomes Para("hallo")

    Headers take an additional argument, the level:

    <h1>Head</h1> becomes H(1,"Head")

    Nested tags are the same es nested function calls. Each tag
    is a container and has an append()-method:

    p = Para("hallo")
    p.append("another hallo")

    Each tag-class ctor takes keyword arguments which become
    tag arguments:

    l = OrderedList(type='i')

    creates an <ol type='i'> like list.

    For further info look at the sources, esp. at the HTMLtest
    module.

    Mathias
    Mathias Waack, Oct 1, 2003
    #2
    1. Advertising

  3. Guest


    >
    > Its quite easy:


    Thanks,

    That helps quite a bit.

    Then there are the document classes. Does one normally
    just append element classes to a document and then ask
    the document to print itself?

    Thanks,

    Tobiah
    , Oct 1, 2003
    #3
  4. lid wrote:

    >
    >>
    >> Its quite easy:

    >
    >
    > Thanks,
    >
    > That helps quite a bit.
    >
    > Then there are the document classes. Does one normally
    > just append element classes to a document and then ask
    > the document to print itself?
    >
    > Thanks,
    >
    > Tobiah
    >

    I have stripped one of my scripts to a more or less minimal example below:

    doc = SimpleDocument(title"pageTitle")
    doc.meta = Meta(name="keywords",content="Keywords")
    row = TR()
    row.append(TD("text")),valign="TOP",bgcolor="#FFFFFF"),"\n")
    doc.append(TableLite(row))
    doc.write("name.html"))

    kind regards Gerrit
    --
    Gaudi systems architecting:
    http://www.extra.research.philips.com/natlab/sysarch/
    Gerrit Muller, Oct 2, 2003
    #4
  5. John Dean Guest

    lid wrote:

    > Checking out HTMLgen, I find the manual
    > to be quite terse, and difficult to crack.
    >
    > Are there any examples or tutorials available
    > for this package?
    >
    > Thanks,
    >
    > Tobiah


    Unfortunately, that's all there is with the exception of a very small
    section in the O'Reilly book, "Python Programming".
    What I would like to know is, is HTMLgen still actively maintained. The
    reason I ask is because I have added quite a bit of new stuff and I would
    like to have my addition included in the main distro. I have tried emailing
    the author but I have not receive a reply.
    If anybody would be interested I could make my mods available of download
    from my web site at http://www.rygannon.com or http://www.totalrekall.co.uk

    --
    Best Regards
    John
    John Dean, Oct 3, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dont bother

    Where to put the HTMLgen files

    dont bother, Apr 30, 2004, in forum: Python
    Replies:
    1
    Views:
    382
    Peter Otten
    Apr 30, 2004
  2. Andre van der Vlies

    Diffs for HTMLgen

    Andre van der Vlies, Sep 1, 2004, in forum: Python
    Replies:
    1
    Views:
    344
    Tim Roberts
    Sep 3, 2004
  3. KYG
    Replies:
    2
    Views:
    883
    Ian Collins
    Aug 18, 2008
  4. Stéphane Wirtel
    Replies:
    0
    Views:
    177
    Stéphane Wirtel
    Apr 19, 2007
  5. Al
    Replies:
    1
    Views:
    150
    Henry Law
    Oct 16, 2005
Loading...

Share This Page