1Pod::Elemental::TransfoUrsmeerr:C:oGnattrhiebruetre(d3P)Poedr:l:EDloecmuemnetnatla:t:iTornansformer::Gatherer(3)
2
3
4

NAME

6       Pod::Elemental::Transformer::Gatherer - gather related paragraphs under
7       a shared header
8

VERSION

10       version 0.103006
11

OVERVIEW

13       Like the Nester transformer, this Gatherer produces structure and
14       containment in a Pod document.  Unlike that Nester, it does not find
15       top-level elements, but instead produces them.
16
17       It looks for all elements matching the "gather_selector".  They are
18       removed from the node.  In the place of the first found element, the
19       "container" node is placed into the transformed node, and all the
20       gathered elements are made children of the container.
21
22       So, given this document:
23
24         Document
25           =head1 Foo
26           =over 4
27           =item * xyzzy
28           =item * abcdef
29           =back
30           =head1 Bar
31           =over 4
32           =item * 1234
33           =item * 8765
34           =back
35
36       ...and this nester...
37
38         my $gatherer = Pod::Elemental::Transformer::Gatherer->new({
39           gather_selector => s_command( [ qw(over item back) ] ),
40           container       => Pod::Elemental::Element::Pod5::Command->new({
41             command => 'head1',
42             content => "LISTS\n",
43           }),
44         });
45
46       Then this:
47
48         $nester->transform_node($document);
49
50       Will result in this document:
51
52         Document
53           =head1 Foo
54           =head1 LISTS
55             =over 4
56             =item * xyzzy
57             =item * abcdef
58             =back
59             =over 4
60             =item * 1234
61             =item * 8765
62             =back
63           =head1 Bar
64

PERL VERSION

66       This library should run on perls released even a long time ago.  It
67       should work on any version of perl released in the last five years.
68
69       Although it may work on older versions of perl, no guarantee is made
70       that the minimum required version will not be increased.  The version
71       may be increased for any reason, and there is no promise that patches
72       will be accepted to lower the minimum required perl.
73

ATTRIBUTES

75   gather_selector
76       This is a coderef (a predicate) used to find the paragraphs to gather
77       up.
78
79   container
80       This is a Pod::Elemental::Node that will be inserted into the node,
81       containing all gathered elements.
82

AUTHOR

84       Ricardo SIGNES <cpan@semiotic.systems>
85
87       This software is copyright (c) 2022 by Ricardo SIGNES.
88
89       This is free software; you can redistribute it and/or modify it under
90       the same terms as the Perl 5 programming language system itself.
91
92
93
94perl v5.36.0                      2023-P0o1d-:2:0Elemental::Transformer::Gatherer(3)
Impressum