June 2002
Beginner
759 pages
80h 42m
English
The HTML::FormatText module takes a parsed HTML file and outputs a plain-text version of it. None of the character attributes will be usable, i.e., bold or italic fonts, font sizes, etc.
This module is similar to FormatPS in that the
constructor takes attributes for formatting, and the format method produces the output. A
formatter object can be constructed like this:
$formatter = HTML::FormatText->new(leftmargin => 10, rightmargin => 80);
The constructor can take two parameters: leftmargin and rightmargin. The value for the margins is
given in column numbers. The aliases lm and rm can also be used.
The format method takes an
HTML::TreeBuilder object and returns a scalar containing the
formatted text. You can print it with:
print $formatter->format($html);