HTML-Formatter-2.16000755000765000024 013021751221 13523 5ustar00nigelstaff000000000000README100644000765000024 1117713021751221 14513 0ustar00nigelstaff000000000000HTML-Formatter-2.16NAME HTML::Formatter - Base class for HTML formatters VERSION version 2.16 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); 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 $formatter-format( $tree )> with an HTML::TreeBuilder (or HTML::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 HTML-Formatter as detailed in "DISTRIBUTION NAME" METHODS new my $formatter = FormatterClass->new( option1 => value1, option2 => value2, ... ); This creates a new formatter object with the given options. format_file 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 SomeClass->new( ... )->format( ... ) on a new HTML::TreeBuilder object based on the given HTML file. format_string 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 SomeClass->new( ... )->format( ... ) on a new HTML::TreeBuilder object based on the given source. 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. DISTRIBUTION NAME This module was originally named HTML-Format despite not containing a HTML::Format module within it. As rules on naming have been taken more seriously, and the PAUSE toolchain adapted so that getting the distribution indexed was more difficult, it became obvious that I should rename the distribution to HTML-Formatter matching the base HTML::Formatter module. As of release 2.13 this is released as the HTML-Formatter 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. SEE ALSO The three specific formatters:- HTML::FormatText Format HTML into plain text HTML::FormatPS Format HTML into postscript HTML::FormatRTF Format HTML into Rich Text Format Also the HTML manipulation libraries used - HTML::TreeBuilder, HTML::Element and HTML::Tree SUPPORT Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at http://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Formatter. You will be notified automatically of any progress on your issue. Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. https://github.com/nigelm/html-formatter git clone https://github.com/nigelm/html-formatter.git AUTHORS * Nigel Metheringham * Sean M Burke * Gisle Aas 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. Changes100644000765000024 1264513021751221 15127 0ustar00nigelstaff000000000000HTML-Formatter-2.162.16 2016-12-07 09:12:41+00:00 Europe/London - Public release after a period on test with the smokers 2.15 2016-12-01 15:40:16+00:00 Europe/London (TRIAL RELEASE) - Deal with some relatively harmless test failures - RT#11783 fixes for Markdown fragment issues - Series of changes for UTF support from Sam Kington - Better travis handling 2.14 2015-10-13 14:46:01+01:00 Europe/London - Added Travis CI status to main documentation - First official release under new distribution name following trial release. 2.13 2015-10-12 16:26:46+01:00 Europe/London (TRIAL RELEASE) - Renamed distribution from HTML-Format -> HTML-Formatter - Documentation update within the main POD to reflect name change - No functional changes 2.12 2015-10-10 17:49:45+01:00 Europe/London - Minor test related fixes - Transition to using File::Slurper in place of File::Slurp Thanks to Karen Etheridge for the patch - Add Travis CI integration 2.11 2013-10-27 20:57:23 Europe/London - Typo fixes from dsteinbrunner https://github.com/nigelm/html-format/pull/2 - Markdown support from mrallen1 https://github.com/nigelm/html-format/pull/1 2.10 2011-07-18 17:07:35 Europe/London - Tests reworked to not use subtests. Development versions of Test::More do not support subtests, and the smokers that are running with these dev versions then send me confusing test failures. This is a pain. 2.09 2011-07-15 14:20:12 Europe/London - Reworking of HTML quote issue in FormatPS - Now remap all double quotes to " in FormatPS (which is not really right, but the best I can do with latin1 output) 2.08 2011-07-13 16:20:54 Europe/London - RT#69426 - issues with HTML quotes - UTF8 handling requires perl 5.8, so minimum requirement bumped 2.07 2011-04-20 16:08:15 Europe/London - Release unchanged except for version number after a period to see if test release threw up any issues... 2.06 2011-04-15 12:01:33 Europe/London - Code gardening - no functionality modifications - includes:- - Moved old DEBUG framework to Smart::Comments - Ensured variables are declared my as much as possible - Ensure strict/warnings used as far as possible - use base rather than playing games with @ISA - Changes above enforce a requirement of perl 5.6.1 - Robo-reformatted by perltidy - Stripped function prototypes where used - Passes standard perl critic with one exclusion - Tweaks for comprehensibility - splitting sections etc 2.05 2011-02-18 11:28:33 Europe/London - Smoke tests on windows showed needed make PS tests less strict - Changed the github location to be all lowercase - Releasing this as a stop gap - will do further work now incompatibilities dealt with 2.04.02 2011-02-16 11:30:24 Europe/London - Added dependancies for font metrics files - Documentation tidy up - but needs further work - new TRIAL release - intend to push this as full release if OK 2.04.01 2011-02-14 20:26:07 Europe/London - Git conversion - Dist::Zilla conversion - RT#54636 - UNIVERSAL::Can deprecated - RT#56278 - RTF formatting parameters ignored by new - Start of a new test harness - TRIAL release pushed out. Aiming to improve docs and maybe hit rest of RT queue before a full release. 2.04 2004-06-01 Sean M. Burke - just cosmetic doc changes - Also, bumping all the version numbers up to 2.04 just for fun. 2.03 2002-11-22 Sean M. Burke - minor bugfix The lack of \plain's in HTML::FormatRTF's output was confusing some formatters. Fixed. 2.02 2002-11-16 Sean M. Burke - minor bugfix Changed the set_version_tag method in HTML::Formatter to avoid some undef warnings that "James W. Durkin" found. No big bug reports on the previous version, so maybe it's not so experimental after all! 2.01 2002-11-07 Sean M. Burke - experimental major version change - Added HTML::FormatRTF. - Lots of internal changes to HTML::FormatPS and HTML::Formatter. - Added format_file and format_string methods to HTML::Formatter. - Lots of little tidying up in the docs. 1.24 2002-10-29 Sean M. Burke - Just taking it over from Gisle, and releasing this to make sure CPAN et al register this change. 1.23 2000-06-09 Gisle Aas - Skip