![]() |
![]()
| ![]() |
![]()
NAMEHTML::T5 - HTML validation in a Perl object VERSIONVersion 0.014 SYNOPSISuse HTML::T5; my $tidy = HTML::T5->new( {config_file => 'path/to/config'} ); $tidy->ignore( type => TIDY_WARNING, type => TIDY_INFO ); $tidy->parse( "foo.html", $contents_of_foo ); for my $message ( $tidy->messages ) { print $message->as_string; } DESCRIPTION"HTML::T5" is an HTML checker in a handy dandy object. It's meant as a replacement for HTML::Lint. If you're currently an HTML::Lint user looking to migrate, see the section "Converting from HTML::Lint". "HTML::T5" was forked from HTML::Tidy5 by Andy Lester (PETDANCE), thanks. EXPORTSMessage types "TIDY_ERROR", "TIDY_WARNING" and "TIDY_INFO". Everything else is an object method. METHODSnew()Create an HTML::T5 object. my $tidy = HTML::T5->new(); Optionally you can give a hashref of configuration parms. my $tidy = HTML::T5->new( {config_file => 'path/to/tidy.cfg'} ); This configuration file will be read and used when you clean or parse an HTML file. You can also pass options directly to tidy. my $tidy = HTML::T5->new( { output_xhtml => 1, tidy_mark => 0, } ); See "tidy -help-config" for the list of options supported by tidy. The following options are not supported by "HTML::T5":
messages()Returns the messages accumulated. clear_messages()Clears the list of messages, in case you want to print and clear, print and clear. If you don't clear the messages, then each time you call parse() you'll be accumulating more in the list. ignore( parm => value [, parm => value ] )Specify types of messages to ignore. Note that the ignore flags must be set before calling parse(). You can call ignore() as many times as necessary to set up all your restrictions; the options will stack up.
parse( $filename, $str [, $str...] )Parses a string, or list of strings, that make up a single HTML file. The $filename parm is only used as an identifier for your use. The file is not actually read and opened. Returns true if all went OK, or false if there was some problem calling tidy, or parsing tidy's output. clean( $str [, $str...] )Cleans a string, or list of strings, that make up a single HTML file. Returns the cleaned string as a single string. tidy_library_version()Returns the version of the underling tidy library. INSTALLING TIDY"HTML::T5" requires that Alien::TidyHTML5, which provides the C "html-tidy" library or ascertains its presence, be installed on your system. Normally this happens by installing "HTML::T5" from CPAN, but you may need to have a C compiler installed. You can probably obtain html-tidy through your distribution's package manager (make sure you install the development package with headers). You can also check the html-tidy home page is <http://www.html-tidy.org/>. CONVERTING FROM "HTML::Lint""HTML::T5" is different from "HTML::Lint" in a number of crucial ways.
BUGS & FEEDBACKPlease report any bugs or feature requests at the issue tracker on github <http://github.com/shlomif/html-tidy5/issues>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. Please do NOT use <http://rt.cpan.org>. SUPPORTYou can find documentation for this module with the perldoc command. perldoc HTML::T5 You can also look for information at:
MOTIVATIONHTML::Tidy5 is painful to install on <https://en.wikipedia.org/wiki/Continuous_integration> services, and even my <https://github.com/shlomif/ci-gen-framework> cannot help enough. We hope that this fork based on Alien::TidyHTML5 will ease the installation pains and allow for less CPAN Testers failure. MEDIA LINKSGetting the green test bar (= for success) reminds me of this performance of "Green Light" by Lorde, live at Glastonbury <http://www.shlomifish.org/Files/files/video/Lorde%20-%20Green%20Light%20(Glastonbury%202017)-Y3urw1bnEMM.webm> which used to be on YouTube but the account was terminated. ACKNOWLEDGEMENTSThanks to Rufus Cable, Jonathan Rockway, and Robert Bachmann for contributions. Thanks to <https://github.com/robrwo> for the code to use Alien::TidyHTML5 . Thanks to Andy Lester for maintaining HTML::Tidy5 and HTML::Tidy. AUTHORShlomi Fish, <https://www.shlomifish.org/>, <https://metacpan.org/author/SHLOMIF> COPYRIGHT & LICENSECopyright (C) 2005-2018 by Andy Lester This library is free software. You may modify or distribute it under the Artistic License v2.0.
|