HTMLgen docs, tutorial

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • user@domain.invalid

    HTMLgen docs, tutorial

    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

  • Mathias Waack

    #2
    Re: HTMLgen docs, tutorial

    user@domain.inv alid wrote:[color=blue]
    > 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?[/color]

    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("anoth er hallo")

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

    l = OrderedList(typ e='i')

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

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

    Mathias

    Comment

    • user@domain.invalid

      #3
      Re: HTMLgen docs, tutorial

      [color=blue]
      >
      > Its quite easy:[/color]

      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

      Comment

      • Gerrit Muller

        #4
        Re: HTMLgen docs, tutorial

        user@domain.inv alid wrote:
        [color=blue]
        >[color=green]
        >>
        >> Its quite easy:[/color]
        >
        >
        > 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
        >[/color]
        I have stripped one of my scripts to a more or less minimal example below:

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

        kind regards Gerrit
        --
        Gaudi systems architecting:


        Comment

        • John Dean

          #5
          Re: HTMLgen docs, tutorial

          user@domain.inv alid wrote:
          [color=blue]
          > 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[/color]

          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

          Comment

          Working...