Class Document - Primary container class for an HTML document.
SYNOPSIS
import HTMLgen
class Document
def __init__(self, resource='', **kw)
def __repr__(self)
def append(self, *items)
def copy(self)
def footer(self)
def header(self)
def htmlhead(self)
def nav_buttons(self)
def prepend(self, *items)
def write(self, filename = None)
DESCRIPTION
Single optional string argument for the path to a resource file
used to specify document parameters. This helps minimize the need
for subclassing from this class. Keyword parameters may be used
for any of the following class attributes. See HTMLtest.py for
example usage.
Add content to the Document object.
Arg items can be plain text or objects; multiple arguments supported.
Return a complete copy of the current Document object.
Generate the standard footer markups.
Generate the standard header markups.
Generate hyperlinked navigation buttons.
If a self.go* attribute is null that corresponding button is
replaced with a transparent gif to properly space the remaining
buttons.
Add content to the beginning of the Document object.
Arg items can be plain text or objects; multiple arguments supported.
Emit the Document html into file.
In Unix you can use environment variables in filenames.
Will print to stdout if no argument.
Class instance attributes and keyword arguments
- base
- object of the Base class
- meta
- object of the Meta class
- cgi
- if non zero will issue a mime type of text/html
- logo
- ('filename', width, height) All images are specified
with a tuple of string, int, int. If the size of the
graphic is unknown, use 0, 0. This one is the little
graphic on the footer of each page.
- banner
- ('filename', width, height) Banner graphic at
the top of page. Can also be set to a string filename
or an Image object. Can be autosized if it's a GIF.
- title
- string to be used as the document title.
- subtitle
- string to be used as the document subtitle.
If non-nil, this string will be used for the doc title
instead of title.
- author
- String used in the copyright notice
- email
- Email address for feedback mailto: tag
- zone
- string used to label the time zone if datetime
is used. By default not used.
- bgcolor
- Color string (can use variables from
HTMLcolors.py)
- background
- string filename of a graphic used as the
doc background.
- textcolor
- Color string used for text. (can use
variables from HTMLcolors.py)
- linkcolor
- Color string used for hyperlinked text.
- vlinkcolor
- Color string used for visited hypertext.
- alinkcolor
- Color string used for active hypertext.
- place_nav_buttons
- Flag to enable/disable the use of
navigation buttons.
Default is on. Set to 0 to disable.
- blank
- Image tuple for the transparent spacer gif
- prev
- Image tuple for the Previous Page button
- next
- Image tuple for the Next Page button
- top
- Image tuple for the Top of Manual button
- home
- Image tuple for the site Home Page button
- goprev
- URL string for the prev button
- gonext
- URL string for the next button
- gotop
- URL string for the top button
- gohome
- URL string for the home button
- scripts
- a single or list of Script objects to be included in the <HEAD>
- onLoad
- Script, which is executed when the document is loaded
- onUnload
- Script, which is executed when the document is unloaded
SEE ALSO
HTMLgen
Copyright © Robin Friedrich
All Rights Reserved
Comments to author: friedric@phoenix.net
Generated: Mon Dec 2 1996