[Bps-public-commit] r11969 - in HTML-RewriteAttributes: lib/HTML/RewriteAttributes

sartak at bestpractical.com sartak at bestpractical.com
Tue Apr 29 18:55:10 EDT 2008


Author: sartak
Date: Tue Apr 29 18:55:08 2008
New Revision: 11969

Modified:
   HTML-RewriteAttributes/   (props changed)
   HTML-RewriteAttributes/lib/HTML/RewriteAttributes/Links.pm

Log:
 r54675 at onn:  sartak | 2008-04-29 18:54:14 -0400
 Doc for Links


Modified: HTML-RewriteAttributes/lib/HTML/RewriteAttributes/Links.pm
==============================================================================
--- HTML-RewriteAttributes/lib/HTML/RewriteAttributes/Links.pm	(original)
+++ HTML-RewriteAttributes/lib/HTML/RewriteAttributes/Links.pm	Tue Apr 29 18:55:08 2008
@@ -6,6 +6,8 @@
 use HTML::Tagset ();
 use URI;
 
+our $VERSION = '0.01';
+
 my %rewritable_attrs;
 
 for my $tag (keys %HTML::Tagset::linkElements) {
@@ -54,3 +56,65 @@
 
 1;
 
+__END__
+
+=head1 NAME
+
+HTML::RewriteAttributes::Links - concise link rewriting
+
+=head1 SYNOPSIS
+
+    # up for some HTML::ResolveLink?
+    $html = HTML::RewriteAttributes::Links->rewrite($html, "http://search.cpan.org");
+
+    # or perhaps HTML::LinkExtor?
+    HTML::RewriteAttributes::Links->rewrite($html, sub {
+        my ($tag, $attr, $value) = @_;
+        push @links, $value;
+        $value;
+    });
+
+=head1 DESCRIPTION
+
+C<HTML::RewriteAttributes::Links> is a special case of
+L<HTML::RewriteAttributes> for rewriting links. 
+
+See L<HTML::ResolveLink> and L<HTML::LinkExtor> for examples of what you can do
+with this.
+
+=head1 METHODS
+
+=head2 C<new>
+
+You don't need to call C<new> explicitly - it's done in L</rewrite>. It takes
+no arguments.
+
+=head2 C<rewrite> HTML, (callback|base)[, args] -> HTML
+
+See the documentation of L<HTML::RewriteAttributes>.
+
+Instead of a callback, you may pass a string. This will mimic the behavior of
+L<HTML::ResolveLink> -- relative links will be rewritten using the given string
+as a base URL.
+
+=head1 SEE ALSO
+
+L<HTML::RewriteAttributes>, L<HTML::Parser>, L<HTML::ResolveLink>, L<HTML::LinkExtor>
+
+=head1 AUTHOR
+
+Shawn M Moore, C<< <sartak at bestpractical.com> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to
+C<bug-html-rewriteattributes at rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-RewriteAttributes>.
+
+=head1 LICENSE
+
+Copyright 2008 Best Practical Solutions, LLC.
+HTML::RewriteAttributes::Links is distributed under the same terms as Perl itself.
+
+=cut
+



More information about the Bps-public-commit mailing list