1HTML::FormatText(3) User Contributed Perl Documentation HTML::FormatText(3)
2
3
4
6 HTML::FormatText - Format HTML as plaintext
7
9 version 2.16
10
12 use HTML::TreeBuilder;
13 $tree = HTML::TreeBuilder->new->parse_file("test.html");
14
15 use HTML::FormatText;
16 $formatter = HTML::FormatText->new(leftmargin => 0, rightmargin => 50);
17 print $formatter->format($tree);
18
19 or, more simply:
20
21 use HTML::FormatText;
22 my $string = HTML::FormatText->format_file(
23 'test.html',
24 leftmargin => 0, rightmargin => 50
25 );
26
28 HTML::FormatText is a formatter that outputs plain text. All character
29 attributes (bold/italic/underline) are ignored. Formatting of HTML
30 tables and forms is not implemented.
31
32 HTML::FormatText is built on HTML::Formatter and documentation for that
33 module applies to this - especially "new" in HTML::Formatter,
34 "format_file" in HTML::Formatter and "format_string" in
35 HTML::Formatter.
36
37 You might specify the following parameters when constructing the
38 formatter:
39
40 leftmargin (alias lm)
41 The column of the left margin. The default is 3.
42
43 rightmargin (alias rm)
44 The column of the right margin. The default is 72.
45
47 HTML::Formatter
48
50 • Nigel Metheringham <nigelm@cpan.org>
51
52 • Sean M Burke <sburke@cpan.org>
53
54 • Gisle Aas <gisle@ActiveState.com>
55
57 This software is copyright (c) 2016 by Nigel Metheringham, 2002-2005
58 Sean M Burke, 1999-2002 Gisle Aas.
59
60 This is free software; you can redistribute it and/or modify it under
61 the same terms as the Perl 5 programming language system itself.
62
63
64
65perl v5.34.0 2022-01-21 HTML::FormatText(3)