line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pod::Weaver::Section::Authors; |
2
|
|
|
|
|
|
|
# ABSTRACT: a section listing authors |
3
|
|
|
|
|
|
|
$Pod::Weaver::Section::Authors::VERSION = '4.017'; |
4
|
5
|
|
|
5
|
|
35310
|
use Moose; |
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
53
|
|
5
|
|
|
|
|
|
|
with 'Pod::Weaver::Role::Section'; |
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
35945
|
use Pod::Elemental::Element::Nested; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
172
|
|
8
|
5
|
|
|
5
|
|
34
|
use Pod::Elemental::Element::Pod5::Verbatim; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
1862
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#pod =head1 OVERVIEW |
11
|
|
|
|
|
|
|
#pod |
12
|
|
|
|
|
|
|
#pod This section adds a listing of the documents authors. It expects a C<authors> |
13
|
|
|
|
|
|
|
#pod input parameter to be an arrayref of strings. If no C<authors> parameter is |
14
|
|
|
|
|
|
|
#pod given, it will do nothing. Otherwise, it produces a hunk like this: |
15
|
|
|
|
|
|
|
#pod |
16
|
|
|
|
|
|
|
#pod =head1 AUTHORS |
17
|
|
|
|
|
|
|
#pod |
18
|
|
|
|
|
|
|
#pod Author One <a1@example.com> |
19
|
|
|
|
|
|
|
#pod Author Two <a2@example.com> |
20
|
|
|
|
|
|
|
#pod |
21
|
|
|
|
|
|
|
#pod =attr header |
22
|
|
|
|
|
|
|
#pod |
23
|
|
|
|
|
|
|
#pod The title of the header to be added. |
24
|
|
|
|
|
|
|
#pod (default: "AUTHOR" or "AUTHORS") |
25
|
|
|
|
|
|
|
#pod |
26
|
|
|
|
|
|
|
#pod =cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has header => ( |
29
|
|
|
|
|
|
|
is => 'ro', |
30
|
|
|
|
|
|
|
isa => 'Maybe[Str]', |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub weave_section { |
34
|
7
|
|
|
7
|
0
|
30
|
my ($self, $document, $input) = @_; |
35
|
|
|
|
|
|
|
|
36
|
7
|
50
|
|
|
|
36
|
return unless $input->{authors}; |
37
|
|
|
|
|
|
|
|
38
|
7
|
|
|
|
|
14
|
my $multiple_authors = @{ $input->{authors} } > 1; |
|
7
|
|
|
|
|
28
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# I think I might like to have header be a callback or something, so that you |
41
|
|
|
|
|
|
|
# can get pluralization for your own custom header. -- rjbs, 2015-03-17 |
42
|
7
|
|
33
|
|
|
221
|
my $name = $self->header || ($multiple_authors ? 'AUTHORS' : 'AUTHOR'); |
43
|
|
|
|
|
|
|
|
44
|
7
|
|
|
|
|
76
|
$self->log_debug("adding $name section"); |
45
|
7
|
|
|
|
|
187
|
$self->log_debug("author = $_") for @{ $input->{authors} }; |
|
7
|
|
|
|
|
65
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
my $authors = [ map { |
48
|
14
|
|
|
|
|
1574
|
Pod::Elemental::Element::Pod5::Ordinary->new({ |
49
|
|
|
|
|
|
|
content => $_, |
50
|
|
|
|
|
|
|
}), |
51
|
7
|
|
|
|
|
148
|
} @{ $input->{authors} } ]; |
|
7
|
|
|
|
|
27
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$authors = [ |
54
|
|
|
|
|
|
|
Pod::Elemental::Element::Pod5::Command->new({ |
55
|
|
|
|
|
|
|
command => 'over', content => '4', |
56
|
|
|
|
|
|
|
}), |
57
|
|
|
|
|
|
|
( map { |
58
|
7
|
50
|
|
|
|
1359
|
Pod::Elemental::Element::Pod5::Command->new({ |
|
14
|
|
|
|
|
2759
|
|
59
|
|
|
|
|
|
|
command => 'item', content => '*', |
60
|
|
|
|
|
|
|
}), |
61
|
|
|
|
|
|
|
$_, |
62
|
|
|
|
|
|
|
} @$authors ), |
63
|
|
|
|
|
|
|
Pod::Elemental::Element::Pod5::Command->new({ |
64
|
|
|
|
|
|
|
command => 'back', content => '', |
65
|
|
|
|
|
|
|
}), |
66
|
|
|
|
|
|
|
] if $multiple_authors; |
67
|
|
|
|
|
|
|
|
68
|
7
|
|
|
|
|
2311
|
push @{$document->children }, |
|
7
|
|
|
|
|
212
|
|
69
|
|
|
|
|
|
|
Pod::Elemental::Element::Nested->new({ |
70
|
|
|
|
|
|
|
type => 'command', |
71
|
|
|
|
|
|
|
command => 'head1', |
72
|
|
|
|
|
|
|
content => $name, |
73
|
|
|
|
|
|
|
children => $authors, |
74
|
|
|
|
|
|
|
}); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__END__ |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=pod |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=encoding UTF-8 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 NAME |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Pod::Weaver::Section::Authors - a section listing authors |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 VERSION |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
version 4.017 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 OVERVIEW |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This section adds a listing of the documents authors. It expects a C<authors> |
97
|
|
|
|
|
|
|
input parameter to be an arrayref of strings. If no C<authors> parameter is |
98
|
|
|
|
|
|
|
given, it will do nothing. Otherwise, it produces a hunk like this: |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 AUTHORS |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Author One <a1@example.com> |
103
|
|
|
|
|
|
|
Author Two <a2@example.com> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head2 header |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
The title of the header to be added. |
110
|
|
|
|
|
|
|
(default: "AUTHOR" or "AUTHORS") |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 AUTHOR |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Ricardo SIGNES <rjbs@cpan.org> |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This software is copyright (c) 2021 by Ricardo SIGNES. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
121
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |