line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pod::Weaver::Plugin::H1Nester; |
2
|
|
|
|
|
|
|
# ABSTRACT: structure the input pod document into head1-grouped sections |
3
|
|
|
|
|
|
|
$Pod::Weaver::Plugin::H1Nester::VERSION = '4.017'; |
4
|
9
|
|
|
9
|
|
71
|
use Moose; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
87
|
|
5
|
|
|
|
|
|
|
with 'Pod::Weaver::Role::Transformer'; |
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
67555
|
use namespace::autoclean; |
|
9
|
|
|
|
|
121
|
|
|
9
|
|
|
|
|
183
|
|
8
|
|
|
|
|
|
|
|
9
|
9
|
|
|
9
|
|
812
|
use Pod::Elemental::Selectors -all; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
127
|
|
10
|
9
|
|
|
9
|
|
9027
|
use Pod::Elemental::Transformer::Nester; |
|
9
|
|
|
|
|
693376
|
|
|
9
|
|
|
|
|
1665
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#pod =head1 OVERVIEW |
13
|
|
|
|
|
|
|
#pod |
14
|
|
|
|
|
|
|
#pod This plugin is very, very simple: it uses the |
15
|
|
|
|
|
|
|
#pod L<Pod::Elemental::Transformer::Nester> to restructure the document under its |
16
|
|
|
|
|
|
|
#pod C<=head1> elements. |
17
|
|
|
|
|
|
|
#pod |
18
|
|
|
|
|
|
|
#pod =cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub transform_document { |
21
|
29
|
|
|
29
|
0
|
113
|
my ($self, $document) = @_; |
22
|
|
|
|
|
|
|
|
23
|
29
|
|
|
|
|
189
|
my $nester = Pod::Elemental::Transformer::Nester->new({ |
24
|
|
|
|
|
|
|
top_selector => s_command([ qw(head1) ]), |
25
|
|
|
|
|
|
|
content_selectors => [ |
26
|
|
|
|
|
|
|
s_flat, |
27
|
|
|
|
|
|
|
s_command( [ qw(head2 head3 head4 over item back) ]), |
28
|
|
|
|
|
|
|
], |
29
|
|
|
|
|
|
|
}); |
30
|
|
|
|
|
|
|
|
31
|
29
|
|
|
|
|
4941
|
$nester->transform_node($document); |
32
|
|
|
|
|
|
|
|
33
|
29
|
|
|
|
|
142285
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=pod |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=encoding UTF-8 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Pod::Weaver::Plugin::H1Nester - structure the input pod document into head1-grouped sections |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VERSION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
version 4.017 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 OVERVIEW |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
This plugin is very, very simple: it uses the |
56
|
|
|
|
|
|
|
L<Pod::Elemental::Transformer::Nester> to restructure the document under its |
57
|
|
|
|
|
|
|
C<=head1> elements. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 AUTHOR |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Ricardo SIGNES <rjbs@cpan.org> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This software is copyright (c) 2021 by Ricardo SIGNES. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
68
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |