PFT::Map(3)
π 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β ThePFT::Map::Indexobject 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 aPFT::Content::Base(or any subclass) object, returns the associated node, orundefif such node does not exist. π«Άid_to_nodeβ Given a unique mnemonic id (as inPFT::Content::Node::id) returns the associated node, orundefif 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
- fedora 43: perl-PFT 1.4.1-18.fc43 Β· GPL-3.0-or-later
- fedora 44: perl-PFT 1.4.1-18.fc43 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms