Vulnerabilities | |||||
---|---|---|---|---|---|
Version | Suggest | Low | Medium | High | Critical |
2.16 | 0 | 0 | 0 | 0 | 0 |
2.15-TRIAL | 0 | 0 | 0 | 0 | 0 |
2.14 | 0 | 0 | 0 | 0 | 0 |
2.13-TRIAL | 0 | 0 | 0 | 0 | 0 |
2.16 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform
Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.
GPL-1.0-or-later - GNU General Public License v1.0 or later=pod
=encoding UTF-8
=head1 NAME
HTML::Formatter - Base class for HTML formatters
=head1 VERSION
version 2.16
=for test_synopsis 1; END
=for stopwords dependancies formatters CPAN homepage
=head1 SYNOPSIS
use HTML::FormatSomething; my $infile = "whatever.html"; my $outfile = "whatever.file"; open OUT, ">$outfile" or die "Can't write-open $outfile: $!\n";
print OUT HTML::FormatSomething->format_file( $infile, 'option1' => 'value1', 'option2' => 'value2', ... ); close(OUT);
=head1 DESCRIPTION
HTML::Formatter is a base class for classes that take HTML and format it to some output format. When you take an object of such a base class and call C<$formatter->format( $tree )> with an LHTML::TreeBuilder (or LHTML::Element) object, they return the appropriately formatted string for the input HTML.
HTML formatters are able to format a HTML syntax tree into various printable formats. Different formatters produce output for different output media. Common for all formatters are that they will return the formatted output when the format() method is called. The format() method takes a HTML::Element object (usually the HTML::TreeBuilder root object) as parameter.
The distribution name has been changed to C as detailed in L
=head1 METHODS
=head2 new
my $formatter = FormatterClass->new(
option1 => value1, option2 => value2, ...
);
This creates a new formatter object with the given options.
=head2 format_file
=head2 format_from_file
$string = FormatterClass->format_file(
$html_source,
option1 => value1, option2 => value2, ...
);
Return a string consisting of the result of using the given class to format the given HTML file according to the given (optional) options. Internally it calls C<< SomeClass->new( ... )->format( ... ) >> on a new HTML::TreeBuilder object based on the given HTML file.
=head2 format_string
=head2 format_from_string
$string = FormatterClass->format_string(
$html_source,
option1 => value1, option2 => value2, ...
);
Return a string consisting of the result of using the given class to format the given HTML source according to the given (optional) options. Internally it calls C<< SomeClass->new( ... )->format( ... ) >> on a new HTML::TreeBuilder object based on the given source.
=head2 format
my $render_string = $formatter->format( $html_tree_object );
This renders the given HTML object according to the options set for $formatter.
After you've used a particular formatter object to format a particular HTML tree object, you probably should not use either again.
=head1 DISTRIBUTION NAME
This module was originally named C despite not containing a CHTML::Format module within it. As rules on naming have been taken more seriously, and the L<PAUSE|https://pause.perl.org/> toolchain adapted so that getting the distribution indexed was more difficult, it became obvious that I should rename the distribution to C matching the base LHTML::Formatter module.
As of release 2.13 this is released as the C distribution with corresponding changes to the git repository name and associated items.
Due to the way that the module is put together this should have no effect on code using the module. The only issues will be where the distribution name was used within dependancies.
=head1 SEE ALSO
The three specific formatters:-
=over
=item LHTML::FormatText
Format HTML into plain text
=item LHTML::FormatPS
Format HTML into postscript
=item LHTML::FormatRTF
Format HTML into Rich Text Format
=back
Also the HTML manipulation libraries used - LHTML::TreeBuilder, LHTML::Element and LHTML::Tree
=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
=head1 SUPPORT
=head2 Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker at Lhttp://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Formatter. You will be notified automatically of any progress on your issue.
=head2 Source Code
This is open source software. The code repository is available for public review and contribution under the terms of the license.
Lhttps://github.com/nigelm/html-formatter
git clone https://github.com/nigelm/html-formatter.git
=head1 AUTHORS
=over 4
=item *
Nigel Metheringham nigelm@cpan.org
=item *
Sean M Burke sburke@cpan.org
=item *
Gisle Aas gisle@ActiveState.com
=back
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Nigel Metheringham, 2002-2005 Sean M Burke, 1999-2002 Gisle Aas.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
=cut