HTML::LinkAdd - Add hyperlinks to phrases in HTML documents
use HTML::LinkAdd; my $page = new HTML::LinkAdd( 'testinput1.html', { 'the clocks were striking thirteen'=>'footnotes.html#OrwellG-1', 'updated' => ['updated.html', 'View the latest update], }); warn $page -> hyperlinked; $page ->save ('output.html');
A simple object that accepts a class reference, a path to a file, and a hash of text-phrase/link-URLs, and supplies a method to obtain the HTML with supplied hyperlinks interpolated.
If the values of the supplied has are anonymous lists, the first value should a URI, the second escaped text to place in the link's title attribute.
title
The phrase to hyperlink will be skipped if it appears in a context that prevents linking, as defined in %$HTML::LinkAdd::SKIP. This is currently head, script, style>, pre, xmp, textarea, object, and a.
%$HTML::LinkAdd::SKIP
head
script
style
pre
xmp
textarea
object
a
HTML::TokeParser
Accepts class reference, followed by either a filename or reference to a scalar of HTML (as HTML::TokeParser, and a hash of phrases and hyperlinks.
Returns a scalar that is the updated HTML.
Returns the hyperlinked HTML docuemnt constructed by...the constructor.
Convenience method to save the object's output slot to filename passed as scalar.
output
Returns undef on failure, 1 on success.
1
HTML::TokeParse.
Add support for linking images by source or ID.
ID
Lee Goddard lgoddard@cpan.org
lgoddard@cpan.org
Copyright 2001 (C) Lee Goddard. All Rights Reserved. This is free software and you may use, abuse, amend and distribute under the same terms as Perl itself.
To install HTML::LinkAdd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::LinkAdd
CPAN shell
perl -MCPAN -e shell install HTML::LinkAdd
For more information on module installation, please visit the detailed CPAN module installation guide.