Pod::T...erlLib(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

πŸ¦‹ Pod::Tree::PerlLib πŸ¦‹

okay bestie, so this whole page is Pod::Tree::PerlLib(3pm) from the Perl docs, and it's literally just here to tell you how to turn module PODs into HTML. it's giving "underrated utility module that runs the whole docs website" energy πŸ’… no cap.


✨ NAME ✨

Pod::Tree::PerlLib β€” translate module PODs to HTML. that's it, that's the whole job, and she does it beautifully πŸŽ€


🌸 SYNOPSIS 🌸

$perl_map = Pod::Tree::PerlMap->new;
$perl_lib = Pod::Tree::PerlLib->new( $perl_dir, $HTML_dir, $perl_map, %opts );

$perl_lib->scan(@INC);
$perl_lib->index;
$perl_lib->translate;

$top = $perl_lib->get_top_entry;

like, five lines and you've got a whole HTML doc site. main character behavior honestly πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

Pod::Tree::PerlLib translates module PODs to HTML. lowkey the whole point.

it does a recursive subdirectory search through a list of directories (typically @INC) to find PODs. just, like, hunting them down in every folder. obsessed πŸ”

Pod::Tree::PerlLib generates a top-level index of all the PODs that it finds, and writes it to HTML_dir"/lib.html".

Pod::Tree::PerlLib generates and uses an index of the PODs that it finds to construct HTML links. other modules can also use this index. sharing is caring fr fr 🫢


🧚 METHODS 🧚

$perl_lib = new Pod::Tree::PerlLib $perl_dir, $HTML_dir, $perl_map, %options

Creates and returns a new Pod::Tree::PerlLib object. new object, who dis ✨

  • $HTML_dir is the directory where HTML files will be written. that's where the magic lands.
  • $perl_map maps module names to URLs. the lil phonebook of your docs πŸ“–
  • %options are passed through to Pod::Tree::HTML. hand em over, she'll deal.
ngl the $perl_dir argument is included for consistency with the other Pod::Tree::Perl* modules, but is currently unused. it's just there to match the fit. aesthetic consistency only πŸ’…

$perl_lib->scan(@INC)

Does a recursive subdirectory search through @INC to locate module PODs. each module that is identified is entered into $perl_map. collecting them all like pokΓ©mon πŸŽ€

$perl_lib->index

Generates a top-level index of all the modules. the index is written to HTML_dir"/lib.html". your lil table of contents, slay.

$perl_lib->translate

Translates each module POD found by scan to HTML. the HTML pages are written to HTML_dir"/lib/", in a subdirectory hierarchy that maps the module names. so like, nested folders mirroring your namespaces. iconic structure fr 🌈

$perl_lib->get_top_entry

Returns a hash reference of the form

{ URL         => $URL,
  description => $description }

Pod::Tree::PerlTop uses this to build a top-level index of all the Perl PODs. team effort bestie 🀝


πŸ”— LINKING πŸ”—

Pod::Tree::PerlLib expects the second paragraph of the POD to have the form

Foo::Bar - description

and enters Foo::Bar into $perl_map. so like, paragraph two specifically, don't skip it πŸ™ˆ

To link to a module POD, write

L<Foo::Bar>

and boom, hyperlink. iykyk πŸ’«


πŸ“ REQUIRES πŸ“

5.005;
HTML::Stream;
Pod::Tree;
Pod::Tree::HTML;
Pod::Tree::PerlUtil;

yes you need the whole little squad. no skipping members πŸ’œ


⭐ EXPORTS ⭐

Nothing.

literally nothing. she keeps to herself. no exports, no drama, periodt πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

Pod::Tree::HTML, Pod::Tree::PerlMap

go read those too bestie, they're the supporting cast πŸŽ€


πŸ‘‘ AUTHOR πŸ‘‘

Steven McDougall, swmcd@world.std.com

shoutout to the dev, absolute legend 🫢


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.

same terms as Perl, so like, be normal about it and we're good 🌸


and that's the whole vibe check bestie πŸ’– this page came out of perl v5.36.0, dated 2022-11-19, and the manual name is Pod::T...erlLib(3pm) β€” go forth and translate some PODs, you've got this πŸ¦‹βœ¨

πŸ“¦ where this page comes from