=encoding utf-8 =head1 NAME =begin original HTML::Packer - Another HTML code cleaner =end original HTML::Packer - もう一つの HTMLコードクリーナ =head1 VERSION Version 1.000 =head1 DESCRIPTION =begin original A HTML Compressor. =end original HTMLの圧縮 =head1 SYNOPSIS =begin original use HTML::Packer; my $packer = HTML::Packer->init(); $packer->minify( $scalarref, $opts ); To return a scalar without changing the input simply use (e.g. example 2): my $ret = $packer->minify( $scalarref, $opts ); For backward compatibility it is still possible to call 'minify' as a function: HTML::Packer::minify( $scalarref, $opts ); First argument must be a scalarref of HTML-Code. Second argument must be a hashref of options. Possible options are =over 4 =item remove_comments HTML-Comments will be removed if 'remove_comments' has a true value. =item remove_newlines ALL newlines will be removed if 'remove_newlines' has a true value. =item do_javascript Defines compression level for javascript. Possible values are 'minify', 'shrink' and 'base62'. Default is no compression for javascript. This option only takes effect if L is installed. =item do_stylesheet Defines compression level for CSS. Possible values are 'minify' and 'pretty'. Default is no compression for CSS. This option only takes effect if L is installed. =item no_compress_comment If not set to a true value it is allowed to set a HTML comment that prevents the input being packed. Is set by default. =back =end original use HTML::Packer; my $packer = HTML::Packer->init(); $packer->minify( $scalarref, $opts ); 入力を変更することなくスカラを返すため, シンプルに使えます. (次の例のように) my $ret = $packer->minify( $scalarref, $opts ); 後方互換のために, 関数形式で minifyを呼ぶことも可能です. HTML::Packer::minify( $scalarref, $opts ); 第一引数は HTMLコードのスカラリファレンスです. 第二引数はオプションをハッシュリファレンスで指定します. 指定可能なオプションは =over 4 =item remove_comments 'remove_comments'が真であれば, HTMLコメントを取り除きます. =item remove_newlines 'remove_newlines'が真であれば, すべての改行を取り除きます. =item do_javascript javascriptの圧縮レベルを定義します. 'minify', 'shrink', 'base62'の値を指定することができます. デフォルトでは javascriptを圧縮しません. このオプションは Lがインストールされている場合のみ, 有効となります. =item do_stylesheet CSSの圧縮レベルを定義します. 'minify', 'pretty'の値を指定することができます. デフォルトでは CSSを圧縮しません. このオプションは Lがインストールされている場合のみ, 有効となります. =item no_compress_comment 真が設定されない場合, 圧縮を抑制することを示すコメントの設定を許可します. がデフォルトのコメントとして設定されています. =back =head1 AUTHOR Merten Falk, C<< >> =head1 BUGS =begin original Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =end original バグレポート, 機能の要望については Cか, Webインタフェースの L までお願いします. 通知を受けて, 報告されたバグについて変更を加えた場合, 自動的にあなたにも通知されます. =head1 SUPPORT =begin original You can find documentation for this module with the perldoc command. perldoc HTML::Packer =end original このモジュールのドキュメントは perldocコマンドを使って見ることができます. perldoc HTML::Packer =head1 COPYRIGHT & LICENSE Copyright 2009 - 2011 Merten Falk, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L =cut