ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/doc/lib/PodHTML2.pm
Revision: 1.4
Committed: Wed Jul 25 01:06:22 2007 UTC (19 years, 1 month ago) by pippijn
Branch: MAIN
Changes since 1.3: +2 -2 lines
Log Message:
corrected license

File Contents

# User Rev Content
1 pippijn 1.1 package PodHTML2;
2    
3     use strict;
4     use warnings;
5     use utf8;
6    
7 pippijn 1.4 use constant rcsid => '$Id: PodHTML2.pm,v 1.3 2007-07-25 01:05:17 pippijn Exp $';
8 pippijn 1.2
9     use base qw/PodHTML/;
10 pippijn 1.1
11     sub view_head1 {
12     my ($self, $item) = @_;
13     $item->title->present ($self), "\n\n",
14     $item->content->present ($self)
15     }
16    
17     sub view_seq_link {
18     my ($self, $item) = @_;
19     my ($title, $link) = split '\|', $item, 2;
20 pippijn 1.2 if ($link) {
21     return "<a href='$link'>$title</a>"
22     } else {
23     return "<a href='$title'>$title</a>"
24     }
25 pippijn 1.1 }
26    
27     sub view_item {
28     my ($self, $item) = @_;
29     my $title;
30     if ($item->title =~ /^L</) {
31     $title = $item->title;
32     $title =~ s/L<(.+)>/- $1/;
33     $title = $self->xmlise ($title);
34     $title = $self->view_seq_link ($title);
35     } else {
36     $title = $item->title;
37     $title = $self->xmlise ($title);
38     }
39    
40     '<li>', ($item->title eq '*' ? '<b>---</b> ' : '<b>' . $title . '</b> '), $item->content->present ($self), '</li>'
41     }
42    
43 pippijn 1.2 sub view_for {
44     my ($self) = @_;
45     for ($_[1]->format) {
46     /^date/ and return "<b>" . $_[1]->text . "</b>";
47     return $self::SUPER->view_for ($_[1]);
48     }
49     }
50    
51 pippijn 1.3 =head1 AUTHOR
52    
53     Copyright © 2007 Pippijn van Steenhoven
54    
55     =head1 LICENSE
56    
57     This library is free software, you can redistribute it and/or modify
58 pippijn 1.4 it under the terms of the GNU General Public License.
59 pippijn 1.3
60     =cut
61    
62     1