Acme-CPANAuthors-MBTI
view release on metacpan or search on metacpan
inc/expand_author_list.pm view on Meta::CPAN
return <<"EOF";
# Code inserted by inc/expand_author_list#authors_to_code
# by $plugin_name $plugin_version
## no critic (ValuesAndExpressions::RestrictLongStrings)
my \%authors = (
$authors);
my \%avatar_urls = (
$avatar_urls);
## use critic
=method authors
my \$scalar_ref = Acme::CPANAuthors::${category}\->authors;
my \%hash = Acme::CPANAuthors::${category}\->authors;
=cut
sub authors { return ( wantarray ? \%authors : \\\%authors ) }
=method category
my \$scalar = Acme::CPANAuthors::${category}\->category;
=cut
sub category { return '$category' }
=method avatar_url
my \$url = Acme::CPANAuthors::${category}\->avatar_url('$display_authors[0]->{id}');
=cut
sub avatar_url {
my ( \$id ) = \@_;
return \$avatar_urls{\$id};
}
# end generated code
EOF
}
sub authors_to_avatars {
my (%config) = ref $_[0] ? %{ $_[0] } : @_;
my $plugin = $config{plugin};
my $plugin_name = $config{plugin_name} // ref $config{plugin};
my $plugin_version = $config{plugin_version} // $plugin_name->VERSION;
my @lines;
for my $author ( @{ $config{data} } ) {
my $name = encode_entities( $author->{name} );
my $title = "$author->{id} ($name), $author->{dists} distribution" . ( $author->{dists} != 1 ? 's' : '' );
push @lines,
qq{<a href="http://metacpan.org/author/$author->{id}">}
. q{<span>}
. q{<img style="margin: 0 5px 5px 0;" width="80" height="80" }
. qq{src="$author->{avatar}" alt="$author->{id}" title="$title" />}
. q{</span>} . q{</a>};
}
my $content = join( "<!--\n-->", @lines );
return <<"EOF";
<div style="text-align:center;padding:0px!important;overflow-y:hidden;
margin-left: auto; margin-right: auto; max-width: 430px">
<!-- Data inserted by inc/expand_author_list#authors_to_avatars
by $plugin_name $plugin_version -->
$content
</div>
EOF
}
sub mbti_type {
my ($type) = @_;
return <<"EOF";
L<< C<$type>|https://en.wikipedia.org/wiki/$type >>
EOF
}
sub mbti_description_text {
my ($type) = @_;
my $lctype = lc($type);
return <<"EOF";
For more details see L<< C<Acme::CPANAuthors::MBTI>|Acme::CPANAuthors::MBTI >>.
=over 4
=item * L<< C<$type> on personalitypage.com|http://personalitypage.com/$type.html >>
=item * L<< C<$type> on typelogic.com|http://typelogic.com/$lctype.html >>
=item * L<< C<$type> on Wikipedia|https://en.wikipedia.org/wiki/$type >>
=back
EOF
}
sub mbti_description {
my (%config) = ref $_[0] ? %{ $_[0] } : @_;
my $html = authors_to_avatars( \%config );
my $description = mbti_description_text( $config{type} );
my $link = mbti_type( $config{type} );
return <<"EOF";
This class provides a hash of PAUSE ID's and names of authors
who have identified themselves as $link
=begin html
$html
=end html
$description
EOF
}
sub generate_synopsis {
my (%config) = ref $_[0] ? %{ $_[0] } : @_;
( run in 1.258 second using v1.01-cache-2.11-cpan-364913b4093 )