PFT::Map::Node - Node of a PFT site map
PFT::Map::Node->new($seqnr, $id, $content); PFT::Map::Node->new($seqnr, $id, undef, $header); PFT::Map::Node->new($seqnr, $id, $content, $header);
Objects of type PFT::Map::Node are nodes of the site map. They are created within a PFT::Map object. Each node is identified by a unique sequence number and by a mnemonic identifier.
PFT::Map::Node
PFT::Map
The first form of constructor in the SYNOPSIS creates a PFT::Map::Node without providing a header. This is possible because a content item (PFT::Map::Content::Base instance) is provided. The constructor will make an attempt to read the header.
PFT::Map::Content::Base
The second and third forms shall be used when the header is already available (as optimization to avoid the system to fetch it again), or in those situation in which the header cannot be retrieved.
The header cannot be retrieved from entries which do not correspond to a real file (virtual contents). Nodes referring to virtual contents are called virtual nodes. They represent an auto-generated pages within a PFT site (typical case: tag pages and month pages.
See the PFT::Map::Node implementation for further details.
Header associated with this node.
This property could return undef if the node is associated with a non-textual content (something which PFT::Content::Base but not a PFT::Content::Entry).
undef
PFT::Content::Base
PFT::Content::Entry
The content associated with this node.
This property could return undefined for the nodes which do not correspond to any content.
Returns the date of the content, or undef if the content is not recording any date.
Returns the sequential id of the node.
Reported verbatim as by constructor parameter.
Returns the mnemonic identifier, unique for the whole site.
Returns the title of the content.
The title is retrieved from the header. Content items like pictures do not have a header, so they don't have a title: undef is returned if this is the case.
Returns the author of the content.
The author is retrieved from the header. Content items like pictures do not have a header, so they don't have an author: undef is returned if this is the case.
Returns 1 if the node is virtual.
Returns the type of the content. Short for ref($node->content)
ref($node->content)
Routing properties allow to access other nodes. For instance, the prev property of a node will correspond to the previous node in chronological sense. They can be undef (e.g. if the node does not have a predecessor).
prev
The properties are:
next
tags
tagged
days
inlinks
outlinks
children
symbols
Other methods are defined as setters for the mentioned properties. They are currently not documented, but used in PFT::Map.
Expand HTML of the content, translating outbound links into hyper-references (hrefs).
Requires as parameter a callback mapping a PFT::Map::Node object into a string representing path within the site. The callback is applied to all symbols, and the resulting string will replace the symbol placeholder in the HTML.
Returns a string HTML, or an empty string if the node is virtual.
To install PFT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PFT
CPAN shell
perl -MCPAN -e shell install PFT
For more information on module installation, please visit the detailed CPAN module installation guide.