1HTML::FormatText(3) User Contributed Perl Documentation HTML::FormatText(3)
2
3
4
6 HTML::FormatText - Format HTML as plaintext
7
9 version 2.10
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 latin1 text. All
29 character attributes (bold/italic/underline) are ignored. Formatting
30 of HTML 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 See perlmodinstall for information and options on installing Perl
51 modules.
52
54 No bugs have been reported.
55
56 Please report any bugs or feature requests through the web interface at
57 <http://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Format>.
58
60 The project homepage is <http://search.cpan.org/dist/HTML-Format>.
61
62 The latest version of this module is available from the Comprehensive
63 Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find
64 a CPAN site near you, or see
65 <http://search.cpan.org/dist/HTML-Format/>.
66
67 The development version lives at <http://github.com/nigelm/html-format>
68 and may be cloned from <git://github.com/nigelm/html-format.git>.
69 Instead of sending patches, please fork this project using the standard
70 git and github infrastructure.
71
73 · Nigel Metheringham <nigelm@cpan.org>
74
75 · Sean M Burke <sburke@cpan.org>
76
77 · Gisle Aas <gisle@ActiveState.com>
78
80 This software is copyright (c) 2011 by Nigel Metheringham, 2002-2005
81 Sean M Burke, 1999-2002 Gisle Aas.
82
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85
86
87
88perl v5.16.3 2014-06-10 HTML::FormatText(3)