PFT::Map(3)

πŸ“¦ version 1.4.1, in fedora 43, fedora 44

πŸ’– PFT::Map β€” the map of a PFT site πŸ’–

okay so this is the Perl doc for PFT::Map(3), from the User Contributed Perl Documentation corner of the universe. It's a whole vibe, and it's lowkey the bestie that lets you actually navigate around a PFT site. Let's get into it πŸ—ΊοΈβœ¨


✨ SYNOPSIS ✨

my $tree = PFT::Content->new($basedir);
PFT::Map->new($tree);

that's it. that's the whole entrance exam. πŸŽ€


🌸 DESCRIPTION 🌸

The map of a PFT site lets you navigate the site content. Fr fr, that's its whole job and it ate.

This is useful for compiling the site or for figuring out properties of the site β€” like dangling links, important pages… iykyk πŸ¦‹


πŸ“ Properties πŸ“

  • nodes β€” List of the nodes. Just… the nodes. All of them. πŸ’…
  • ids β€” List of the mnemonic ids.

So this:

map $m->id_to_node($_), $m->ids

is equivalent to:

$m->nodes

literally the same thing, two different routes, pick your fave.

  • tree β€” The associated content tree 🌳
  • pages β€” List of page nodes πŸ“„
  • months β€” List of month nodes πŸ“…
  • tags β€” List of tag nodes 🏷️
  • index β€” The PFT::Map::Index object associated to this map.

It handles the unique identifiers of content items and can be used to query the map. main character energy honestly. πŸ‘‘

  • dump β€”
# TODO: move forward this description, as method

Dump of the nodes in a easy-to-display form, that is a list of dictionaries.

This method is used mainly or solely for testing. (a little test-only girlie, we respect her.)


πŸ’œ Methods πŸ’œ

  • node_of β€” Given a PFT::Content::Base (or any subclass) object, returns the associated node, or undef if such node does not exist. 🫢
  • id_to_node β€” Given a unique mnemonic id (as in PFT::Content::Node::id) returns the associated node, or undef if there is no such node.
  • blog_recent β€” Getter for the most N recent blog nodes. Accepts N as strictly positive integer parameter.

In list context returns the N most recent blog nodes, ordered by date, from most to least recent. Less than N nodes will be returned if N is greater than the number of available entries.

In scalar context returns the N-th to last entry. For N equal to zero the most recent entry is returned. 🌈

  • months_recent β€” Getter for the most N recent month nodes. Accepts N as strictly positive integer parameter.

In list context returns the N most recent month nodes, ordered by date, from most to least recent. Less than N nodes will be returned if N is greater than the number of available entries.

In scalar context returns the N-th to last entry. For N equal to zero the most recent entry is returned. The undef value is returned if there are less then N available. 😭

  • blog_exists β€” Checker for blog history. πŸ•°οΈ

Returns a boolean value telling if the site contains at least one blog entry. true or false, no in-between, periodt. ✨


heads up bestie: every one of these is exactly as written β€” no vibes-based guessing, the docs said what they said. πŸ’–

and that's the whole page, no cap. this one's from perl v5.42.0, dated 2025-07-25 β€” slay, go navigate your site, mwah πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from