Pod::T...erlMap(3pm)

πŸ“¦
version 1.31 Β· 2 versions
  • 1.31 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.31 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Pod::Tree::PerlMap β€” bestie, it maps names to URLs. That's the whole job. It's giving phonebook but for links. ✨


🌸 SYNOPSIS 🌸

$perl_map = new Pod::Tree::PerlMap;

$perl_map->add_page  ($name, $file);
$perl_map->add_func  ($func, $file);
$perl_map->force_func(0);
$perl_map->force_func(1);
$perl_map->set_depth ($depth);

($base, $page, $section) = $perl_map->map($base, $page, $section);

πŸ¦‹ DESCRIPTION πŸ¦‹

Pod::Tree::PerlMap takes L<> markups and turns them into URLs. It's the translator of links, the glow-up artist of raw markup. πŸ’…

The Pod::Tree::Perl* translators are the ones who make entries in the map. Then Pod::Tree::HTML uses that map to translate links before it emits them β€” so the link is already slaying by the time it hits your output. πŸ”₯


πŸ‘‘ METHODS πŸ‘‘

πŸ’– $perl_map->"add_page"($name, $file)

Maps $name to $file. $name is the name of a POD, exactly as it's used in L<> markups. $file is the path to the HTML file that is the target of the link. So like, name in, destination out. Iconic. ✨

🌈 $perl_map->"add_func"($func, $file)

Maps $func to $file. $func is the name of a function described in perlfunc.pod. $file is the name of the HTML file where that function is described. 🫢

πŸŽ€ $perl_map->"force_func"($state)

This one controls how links of the form L<func> get interpreted. Big main character energy for such a tiny method.

  • If $state is true, calls to "map" will interpret L<func> as L<perlfunc/func>.
  • If $state is false, calls to "map" will interpret L<func> normally.

That's it. That's the vibe check. βœ…

🧚 $perl_map->"set_depth"($depth)

Tells $perl_map how deep the referring page sits in the HTML directory tree. Why does it need to know, you ask? Because it has to construct relative links, and you can't do that math without knowing where you're standing. It's literally just spatial awareness. 🌸

⭐ ($base, $page, $section) = $perl_map->"map"($base, $page, $section)

Remaps a link. The glow-up moment. πŸ’«

  • $base is the base URL for the HTML page, if any.
  • $page is the page given in an L<> markup.
  • $section is the section given in the L<> markup, if any.

"map" returns a new $base, $page, and $section that you can use to construct a link to the HTML page. New values, same names, no notes. πŸ”₯


πŸ“ REQUIRES πŸ“

Nothing. Not a single thing. Low maintenance queen. πŸ’…


🌟 EXPORTS 🌟

Nothing. It keeps everything to itself, and honestly? Respect. πŸ™ˆ


πŸ’œ AUTHOR πŸ’œ

Steven McDougall, swmcd@world.std.com


Copyright (c) 2000 by Steven McDougall. This module is free software; you can redistribute it and/or modify it under the same terms as Perl.


okay so that's the whole page, bestie β€” no cap, every single flag, arg, default and reference is right there 🫢

This was Pod::T...erlMap(3pm) from the User Contributed Perl Documentation, built on perl v5.36.0 and dated 2022-11-19. Mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from