[libcode-tidyall-perl] 316/374: add

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 22:26:42 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libcode-tidyall-perl.

commit fda3bb353fb2bb4bb5d4b93539dcfbe9cc086a32
Author: Jonathan Swartz <swartz at pobox.com>
Date:   Tue Oct 9 22:36:13 2012 -0700

    add
---
 lib/Code/TidyAll/Plugin/HTMLTidy.pm |   61 +++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/lib/Code/TidyAll/Plugin/HTMLTidy.pm b/lib/Code/TidyAll/Plugin/HTMLTidy.pm
new file mode 100644
index 0000000..a3a3b56
--- /dev/null
+++ b/lib/Code/TidyAll/Plugin/HTMLTidy.pm
@@ -0,0 +1,61 @@
+package Code::TidyAll::Plugin::HTMLTidy;
+use Capture::Tiny qw(capture);
+use Moo;
+extends 'Code::TidyAll::Plugin';
+
+sub _build_cmd { 'tidy' }
+
+sub transform_file {
+    my ( $self, $file ) = @_;
+
+    my ( $output, $error ) =
+      capture { system( sprintf( "%s -modify %s %s", $self->cmd, $self->argv, $file ) ) };
+    die $error if $error;
+}
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Code::TidyAll::Plugin::HTMLTidy - use HTML Tidy with tidyall
+
+=head1 SYNOPSIS
+
+   In configuration:
+
+   [HTMLTidy]
+   select = static/**/*.html
+   argv = -i --indent-size 4 --show-warnings 0
+
+=head1 DESCRIPTION
+
+Runs L<HTML Tidy|http://tidy.sourceforge.net/>, the HTML tidier originally
+created by Dave Raggett and now maintained on sourceforge.
+
+Any warnings or errors will be deemed a validation failure. You can pass
+"--show-warnings 0" and "--show-errors 0" to suppress warnings and errors
+respectively.
+
+=head1 INSTALLATION
+
+Install the C<tidy> executable from the web site above if it is not already on
+your system.
+
+=head1 CONFIGURATION
+
+=over
+
+=item argv
+
+Arguments to pass to tidy. A comprehensive list of configuration options is
+available at http://tidy.sourceforge.net/docs/quickref.html.
+
+=item cmd
+
+Full path to tidy
+
+=back

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git



More information about the Pkg-perl-cvs-commits mailing list