PFT::Map::Index(3)

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

πŸ’– PFT::Map::Index πŸ’–

okay bestie, gather round, because this is PFT::Map::Index from the User Contributed Perl Documentation collection and it is literally the little symbol-resolver that could. no cap, this module resolves symbols in PFT Entries and honestly? iconic behaviour. πŸŽ€


✨ NAME ✨

PFT::Map::Index β€” Resolve symbols in PFT Entries πŸ’…


🌸 SYNOPSIS 🌸

okay so there are like three whole moods you can be in here, and we're gonna walk through every single one.

Explicit construction β€” you're doing it yourself, main character energy:

use PFT::Map::Index;

die unless $map->isa('PFT::Map');
my $index = PFT::Map::Index->new($map);

Using map property β€” letting the map hand you one, lowkey easier:

my $index = $map->index;

Resolution β€” the actual moment we've all been waiting for, bestie:

die unless $node->isa('PFT::Map::Node');
die unless $sym->isa('PFT::Text::Symbol');
$index->resolve($node, $sym);

πŸ¦‹ DESCRIPTION πŸ¦‹

So a PFT::Map::Index object handles the unique identifiers of content items that are mapped in a PFT::Map object. That's its whole job and it does it gorgeously, fr fr.

You can use it to resolve symbols of a PFT::Map::Node, or to query the map β€” for example, the set of entries between date X and date Y. so versatile. 🫢

πŸ“ Properties πŸ“

  • map β€” Reference to the associated map. that's it, that's the property. simple, elegant, slay. ✨

πŸ’œ Methods πŸ’œ

content_id

Given a PFT::Content::Base object (or any subclass of it, we love an inheritance moment πŸ‘‘), this returns a string that uniquely identifies it across the site. E.g.:

my $id = $resolver->content_id($content);
my $id = $resolver->content_id($virtual_page, $hdr);
my $id = $resolver->content_id(undef, $hdr);

okay so about that header β€” the header is optional for the first two forms. unless you supply it, it'll be retrieved by the content. but in the third form the content is not supplied, so the header is mandatory. no header, no id, bestie. that's the rule. πŸ’€

resolve

The function resolves a symbol retrieved from the text of a PFT::Map::Node. The returned value will be one of the following:

  • A list of nodes (i.e. a PFT::Map::Node instances); πŸ’–
  • A list of strings (e.g. http://manpages.org); 🌈
  • An empty list (meaning: failed resolution). 😭
okay so that last one? an empty list means the resolution failed. not me getting an empty list and thinking everything was fine. πŸ™ˆ

and that's the whole page, babe. this was perl v5.42.0, dated 2025-07-25 β€” go forth and resolve those symbols. periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from