|
NAMECGI::Application::Plugin::HtmlTidy - Add HTML::Tidy support to CGI::ApplicationVERSIONversion 1.05SYNOPSISuse CGI::Application::Plugin::HtmlTidy; sub cgiapp_postrun { my ($self, $contentref) = @_; # your post-process code here $self->htmltidy_clean($contentref); } # generate a validation report use CGI::Application::Plugin::DevPopup; use CGI::Application::Plugin::HtmlTidy; CHANGESThis release integrates with CGI::Application::Plugin::DevPopup. If that plugin is active, this one will add an HTML validation report. As a consequence, htmltidy_validate() is no longer exported, and should not be called directly.DESCRIPTIONThis plugin is a wrapper around HTML::Tidy. It exports two methods that allow you to either validate or clean up the output of your cgiapp application. They should be called at the end of your postrun method.The htmltidy_validate method is a helpful addition during development. It generates a detailed report specifying the issues with your html. The htmltidy_clean modifies your output to conform to the W3C standards. It has been in use for quite some time on a largish site (generating over 10 million pages per day) and has proven to be quite stable and fast. Every single page view is valid html, which makes many browsers happy :-) CONFIGURATIONlibtidy is extremely configurable. It has many options to influence how it transforms your documents. HTML::Tidy communicates these options to libtidy through a configuration file. In the future, it may also allow programmatic access to all options.You can specify the configuration using cgiapp's param() method, or in your instance script through the PARAM attribute, or through the htmltidy_config() method. This plugin looks for a parameter named htmltidy_config, whose value should be a hash ref. This hash ref is then passed on directly to HTML::Tidy. Currently the only supported parameter is "config_file". Here's an example: sub setup { my $self = shift; $self->param( htmltidy_config => { config_file => '/path/to/my/tidy.conf', }); } This plugin comes with a default configuration file with the following settings: tidy-mark: no wrap: 120 indent: auto output-xhtml: yes char-encoding: utf8 doctype: loose add-xml-decl: yes alt-text: [image] EXPORT
SEE ALSOCGI::Application, HTML::Tidy.The cgiapp mailing list can be used for questions, comments and reports. The CPAN RT system can also be used. AUTHORRhesa Rozendaal, <rhesa@cpan.org>COPYRIGHT AND LICENSECopyright (C) 2005-2007 by Rhesa RozendaalThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.
Visit the GSP FreeBSD Man Page Interface. |