File Coverage

lib/Egg/Plugin/HTML/TagCloud.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package Egg::Plugin::HTML::TagCloud;
2             #
3             # Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
4             #
5             # $Id: TagCloud.pm 337 2008-05-14 12:30:09Z lushe $
6             #
7 1     1   518 use strict;
  1         2  
  1         43  
8 1     1   6 use warnings;
  1         2  
  1         34  
9 1     1   417 use HTML::TagCloud;
  0            
  0            
10              
11             our $VERSION= '3.00';
12              
13             sub tagcloud {
14             my $e= shift;
15             $_[1] ? HTML::TagCloud->new( levels => (shift || 10) )
16             : HTML::TagCloud->new(@_);
17             }
18              
19             1;
20              
21             __END__
22              
23             =head1 NAME
24              
25             Egg::Plugin::HTML::TagCloud - Plugin to use HTML::TagCloud.
26              
27             =head1 SYNOPSIS
28              
29             package MyApp;
30             use Egg qw/ HTML::TagCloud /;
31            
32             my $array= $e->get_tagging_data;
33            
34             my $cloud= $e->tagcloud(10);
35            
36             $cloud->add($_->{tag_name}, "/tags/$_->{tag_id}", $_->{count}) for @$array;
37            
38             $e->stash->{tagcloud_content}= $cloud->html_and_css;
39              
40             =head1 DESCRIPTION
41              
42             It is a plugin to use L<HTML::TagCloud>.
43              
44             =head1 METHODS
45              
46             =head2 tagcloud ([ARGS])
47              
48             The object of L<HTML::TagCloud> is returned.
49              
50             Especially, the object is not maintained. However, it only returns it.
51              
52             ARGS is an option to pass to L<HTML::TagCloud>.
53              
54             my $cloud= $e->tagcloud( levels => 20 );
55              
56             It is acceptable only to pass the figure.
57              
58             my $cloud= $e->tagcloud(20);
59            
60             When ARGS is omitted ' levels => 10 ' becomes defaults.
61              
62             =head1 SEE ALSO
63              
64             L<Egg::Release>,
65             L<Egg::HTML::TagCloud>,
66              
67             =head1 AUTHOR
68              
69             Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
70              
71             *COPYRIGHT AND LICENSE
72              
73             Copyright (C) 2008 Bee Flag, Corp. E<lt>L<http://egg.bomcity.com/>E<gt>.
74              
75             This library is free software; you can redistribute it and/or modify
76             it under the same terms as Perl itself, either Perl version 5.8.6 or,
77             at your option, any later version of Perl 5 you may have available.
78              
79             =cut
80