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

# Content
1 package PodHTML2;
2
3 use strict;
4 use warnings;
5 use utf8;
6
7 use constant rcsid => '$Id: PodHTML2.pm,v 1.3 2007-07-25 01:05:17 pippijn Exp $';
8
9 use base qw/PodHTML/;
10
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 if ($link) {
21 return "<a href='$link'>$title</a>"
22 } else {
23 return "<a href='$title'>$title</a>"
24 }
25 }
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 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 =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 it under the terms of the GNU General Public License.
59
60 =cut
61
62 1