import HTMLgen
class Heading(AbstractTag) string __module__ = 'HTMLgen' def __str__(self) dictionary attr_dict = {'class': '', 'id': '', 'a ... string attr_template = '%(class)s%(id)s%(style)s% ... tuple attrs = ('class', 'id', 'style', ' ... string attr_template = '' # Methods inherited by Heading from AbstractTag def __add__(self, other) def __call__(self, text) def __init__(self, *contents, **kw) def __len__(self) def __setattr__(self, name, value) def append(self, *items) def copy(self) def empty(self) def last(self) def markup(self, rex=None, marker=None, **kw) def prepend(self, *items)
alias H = Heading alias Head = Heading alias Header = Heading
Heading(level, text, **kw)
The level arg is an integer for the level of the heading. Valid levels are 1-6. The text arg is a string (or any object) for the text of the heading. Keyword arguments are align, Class, and style.
For example:
h = Heading(2, Chapter 3
, align='center')
Support self + list
Enable instances to be callable as text processing functions.
>>> S = HTMLgen.Strong() >>> print S('Hi!') >>> <STRONG>Hi!</STRONG>
Return the integer length of the container list.
Intercept attribute assignments.
If the attribute is a legal HTML tag attribute add it to the dict used for substitution in __str__, otherwise just set it as an instance attribute.
Append one or more items to the end of the container.
Return a full copy of the object.
Empty the contents of the container.
Return a reference to the last item in the container.
Markup the contained text matching a regular expression with a tag class instance or function.
Returns the number of matching text groups.
Prepend one or more items to the top of the container.
Copyright © Robin Friedrich
All Rights Reserved
Comments to author: friedrich@pythonpros.com
Generated: Tue Apr 20, 1999