Pod::El...Gatherer(3)

πŸ’… Pod::Elemental::Transformer::Gatherer πŸ’…

okay bestie, this is the User Contributed Perl Documentation page for Pod::Elemental::Transformer::Gatherer β€” the Gatherer transformer, and yes, we're getting into it. 🫢

🌸 NAME 🌸

Pod::Elemental::Transformer::Gatherer β€” gather related paragraphs under a shared header

πŸŽ€ VERSION πŸŽ€

This one's rocking version 0.103006, periodt.

πŸ”₯ OVERVIEW πŸ”₯

Okay so, same energy as the Nester transformer: this Gatherer produces structure and containment in a Pod document. But unlike that Nester, it does not find top-level elements β€” it literally produces them. Main character behavior, honestly.

It looks for all elements matching the gather_selector. They are removed from the node. In the place of the first found element, the container node is placed into the transformed node, and all the gathered elements are made children of the container.

So, given this document:

Document
  =head1 Foo
  =over 4
  =item * xyzzy
  =item * abcdef
  =back
  =head1 Bar
  =over 4
  =item * 1234
  =item * 8765
  =back

...and this setup:

my $gatherer = Pod::Elemental::Transformer::Gatherer->new({
  gather_selector => s_command( [ qw(over item back) ] ),
  container       => Pod::Elemental::Element::Pod5::Command->new({
    command => 'head1',
    content => "LISTS\n",
  }),
});

Then this:

$nester->transform_node($document);

Will result in this document:

Document
  =head1 Foo
  =head1 LISTS
    =over 4
    =item * xyzzy
    =item * abcdef
    =back
    =over 4
    =item * 1234
    =item * 8765
    =back
  =head1 Bar

🐚 PERL VERSION 🐚

This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years.

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.

✨ ATTRIBUTES ✨

πŸ” gather_selector πŸ”

This is a coderef β€” a predicate β€” used to find the paragraphs to gather up.

πŸ“¦ container πŸ“¦

This is a Pod::Elemental::Node that will be inserted into the node, containing all gathered elements.

πŸ‘‘ AUTHOR πŸ‘‘

Ricardo SIGNES <cpan@semiotic.systems>

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.


okay that's the whole manual, bestie β€” source/version perl v5.42.0, dated 2023-01-01, manual name Pod::El...Gatherer(3). mwah πŸ’–βœ¨

πŸ“¦ where this page comes from