BounceURL(3pm)

πŸ“¦
version 1.61 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– BounceURL(3pm) β€” the manual, but make it cute πŸ’–

User Contributed Perl Documentation Β· Pod::Hyperlink::BounceURL


✨ NAME ✨

Pod::Hyperlink::BounceURL β€” bestie, this is the module that lets off-page links in POD point to a URL πŸ’…


🌸 SYNOPSIS 🌸

use Pod::Hyperlink::BounceURL;
my $linkparser = new Pod::Hyperlink::BounceURL;
$linkparser->configure( URL => '/cgi-perl/support/bounce.pl?page=%s' );
my $pod2xhtml = new Pod::Xhtml( LinkParser => $linkparser );

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: some links in your pod are just... not resolveable by Pod::Hyperlink. like L<Some::Module>? yeah, no, that one's not getting resolved, bestie 😭 This module is the glow-up β€” it lets you detect those unresolved links and generate a hyperlink instead of some sad static text. no more boring plain words, we're giving markup ✨

The target URL will probably be some kind of dynamic webpage or CGI application, which can then serve up the relevant page or send a redirect to the page. That's the whole "bounce" thing in the module's name, iykyk πŸ€

Here's the tea: this module overrides the type() method and, for relevant links, will return a string which is "bounceurl:" followed by the URL β€” instead of returning "page" or "item". Your pod-conversion module can then switch on this case and emit the correct kind of markup. And Pod::Xhtml supports the use of this module. iconic behavior, honestly πŸ‘‘


πŸ’… METHODS πŸ’…

  • configure( %OPTIONS ) β€” set persistent configuration for this object. peep "OPTIONS" for the deets πŸ’–
  • type() β€” behaves exactly like Pod::Hyperlink's type() method, except for the unresolveable links, where the string it returns is the one described up in "DESCRIPTION". slay 🌈

πŸŽ€ OPTIONS πŸŽ€

  • URL β€” the URL that handles the link. it can be absolute or relative, any protocol you want β€” fr fr, it's just treated as a string and passed through sprintf(), with two string arguments that are both already URL-escaped ✨

The first argument is the page name, and it will always exist. The second argument is the "node" within the page, and it may be empty. (yes, empty. it's fine. breathe 🫢)

Insert '%s' where you wish the arguments to be interpolated. But heads up bestie, the string goes through sprintf(), so you should have '%%' where you want an actual percent sign ⚠️ If you need the arguments in a different order, go look at the perl-specific features of "sprintf" in perlfunc. the power is yours πŸ’ͺ


⭐ VERSION ⭐

$Revision: 1.7 $

πŸ‘‘ AUTHOR πŸ‘‘

P Kent <cpan _at_ bbc _dot_ co _dot_ uk>


(c) BBC 2007. This program is free software; you can redistribute it and/or modify it under the GNU GPL.

See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt


and that's the whole page, bestie πŸ₯° go forth and bounce those URLs πŸ’–

written against perl v5.30.0 Β· dated 2020-05-17 Β· mwah, stay slay βœ¨πŸ’…πŸŽ€