ANN: metahtmllib 0.5
Niklas Frykholm
r2d2 at mao.acc.umu.se
Sun Jun 4 06:52:09 EDT 2000
metahtmllib 0.5
by Niklas Frykholm
released under GNU public license
metahtmllib is a Python library for facilitating the transformation of
structured text documents written in HTML-like languages. metahtmllib lets
you separate content (the source document) and form (a set of
transformation rules) so that the same source document can be used to
render HTML, LaTeX, text files, etc, in many different styles. You can
change the layout of any number of documents by only changing the style
rules. The transformation rules are written as Python methods. For
example, a rule for coloring text marked with <HILITE>...</HILITE> red
would look like this:
def hilite(self, text, attr):
return "<FONT COLOR=#ff0000>%s</FONT>" % text
Some of the things which are easy to achieve with this library are for
example: automatic insertion of <P>...</P> tags, automatic insertion of
HEIGHT and WIDTH tags for images, generation of LaTeX and HTML from the
same source document, automatic gathering of indices and tables of
content, etc.
Extensive documentation with helpful examples is provided. Since this is
the first version of the module released to the public,
comments are very welcome.
Download at:
http://www.acc.umu.se/~r2d2/files/python/metahtmllib.html
// Niklas
More information about the Python-list
mailing list