lists.gif
Previous Next Top of Manual blank.gif

HTMLgen 2.2.2 Online Documentation

Lists


FEATURES

The List class and it's children have been structured to allow full nesting of either regular Python data types, (e.g., lists of lists of strings) or HTMLgen objects. For example, an OrderedList class can contain an instance of the List class, ImageBulletList class and DefinitionList class. Added in version 2.0.6 is the capability to render the list into multiple columns. Just set the columns attribute to a number greater than one and it will use that many columns. Also added is the ability to assign a background color through the use of the bgcolor attribute.

The Netscape Navigator extension type tag is supported as an attribute of the List and OrderedList classes and can be set as keyword parameters (although they have different meanings). In List instances you can set the type='disk' | 'circle' | 'square' to hardwire the style of bullet used. In OrderedList instances you can set type='A' | 'a' | 'I' | 'i' to alter the numbering from Arabic to respectively: capital letters, small letters, Roman numerals, small Roman numerals.

Normal list operations apply to all the classes in this family as the base class inherits from the UserList class provided in the core distribution.

The rendered HTML output should also exhibit indentation proportional to the level of list nesting.

Below is some example output. See the HTMLtest.py script for the source code which generated it.


The following section just exercises most of the markup classes.

List class

  1. First item in the OrderedList (ImageBulletList)
      purple_dot.gif Purple
      orange_dot.gif Orange
      red_dot.gif Red
      blue_dot.gif Blue
      green_dot.gif Green
      yellow_dot.gif Yellow
  1. Second item in the OrderedList
    • Items
      • First Item
      • Second Item
        • SubitemA
        • SubitemB
      • Third Item
    • More
This should be initial upper caps
INITIAL UPPER CAPITAL LETTERS
This is normal Text with >< & escaped.
<&>"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is Blockquote markup.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is red text.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is Address markup.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is Emphasis markup.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is Cite markup.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is KBD markup.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is Sample markup.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is Code markup.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is Define markup.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H
This is Var markup.
"Don't play dumb. You're not as good at it as I am.": Colonel Flagg - M*A*S*H


Previous Next Top of Manual blank.gif
Buzz.gif

Copyright © 1996-7 Robin Friedrich
All Rights Reserved
Comments to author: friedrich@pythonpros.com
Generated: Tue Apr 20, 1999