Pod::El...::Nester(3)
π Pod::Elemental::Transformer::Nester(3) π
okay bestie, so this is the manual page for Pod::Elemental::Transformer::Nester β the transformer that groups the document into sections. it lives in the "User Contributed Perl Documentation" section of the perl manpages, and honestly? it's giving organizational queen energy. β¨
πΈ NAME πΈ
Pod::Elemental::Transformer::Nester β group the document into sections. that's it, that's the vibe. π«Ά
β VERSION β
version 0.103006 β yes, we're on 0.103006, write it down, it's iconic.
π OVERVIEW π
okay so the Nester transformer's whole thing is: it goes looking for potential container elements and makes them into actual containers. lowkey a glow-up for your document tree. π
the way it works: you tell it which elements are allowed to become containers, and then which subsequent elements they're allowed to stuff inside themselves. like, "these ones can be a bag, and these ones can go in the bag." iykyk.
for example, given the following nester:
use Pod::Elemental::Selectors qw(s_command s_flat);
my $nester = Pod::Elemental::Transformer::Nester->new({
top_selector => s_command('head1'),
content_selectors => [
s_command([ qw(head2 head3 head4) ]),
s_flat,
],
});
..then when we apply the transformation:
$nester->transform_node($document);
...the nester will find all =head1 elements in the top-level of the document. it will make sure they're represented by objects that perform the Pod::Elemental::Node role, and then it will move all the subsequent elements matching the content_selectors into the container. main character move, no cap. π
so, if we start with this input:
=head1 Header
=head2 Subheader
Pod5::Ordinary <some content>
=head1 New Header
the nester will convert its structure to look like this:
=head1 Header
=head2 Subheader
Pod5::Ordinary <some content>
=head1 New Header
see how the =head2 and the ordinary content got tucked under the first =head1? nesting slay. πͺ
and the moment an element shows up that does not pass the content selectors, the nesting ceases until the next potential container. so it's like, "okay we're done here, next section please." π
π¦ PERL VERSION π¦
this library should run on perls released even a long time ago β like, a long time a long time. it should work on any version of perl released in the last five years. fr fr. π
although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. the version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so don't come for it, it said what it said. π
π ATTRIBUTES π
π top_selector
this attribute must be a coderef (presumably made from Pod::Elemental::Selectors) that will test elements in the transformed node and return true if the element is a potential new container. basically the bouncer at the club deciding who's allowed to be a container. ποΈ
π content_selectors
this attribute must be an arrayref of coderefs (again presumably made from Pod::Elemental::Selectors) that will test whether paragraphs subsequent to the top-level container may be moved under the container. aka the VIP list of who gets to go inside. πΈ
π AUTHOR π
Ricardo SIGNES <cpan@semiotic.systems> β the legend himself. β¨
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2022 by Ricardo SIGNES.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free software bestie, go off. π
and that's the whole page, bestie! per the footer, this is from perl v5.42.0, dated 2023-01-01, and the page itself is Pod::Elemental::Transformer::Nester(3). mwah, go nest some sections ππ«Ά
π¦ where this page comes from
- opensuse-leap 16.0: perl-Pod-Elemental 0.103006-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms