line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# --*-Perl-*-- |
2
|
|
|
|
|
|
|
# $Id: BookmarkLink.pm 11 2004-11-22 23:56:20Z tandler $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package PBib::ReferenceStyle::BookmarkLink; |
6
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
7
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
8
|
|
|
|
|
|
|
#use English; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# for debug: |
11
|
|
|
|
|
|
|
#use Data::Dumper; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
BEGIN { |
14
|
1
|
50
|
|
1
|
|
6
|
use vars qw($Revision $VERSION); q$Revision: 11 $ =~ /: (\d+)/; my ($major, $minor) = (1, $1); $VERSION = "$major." . ($minor<10 ? '0' : '') . $minor; |
|
1
|
|
|
1
|
|
4
|
|
|
1
|
|
|
|
|
134
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
35
|
|
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# superclass |
18
|
1
|
|
|
1
|
|
7
|
use PBib::ReferenceStyle; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
19
|
1
|
|
|
1
|
|
7
|
use base qw(PBib::ReferenceStyle); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
298
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# used modules |
22
|
|
|
|
|
|
|
#use ZZZZ; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# module variables |
25
|
|
|
|
|
|
|
#use vars qw(mmmm); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# format options |
28
|
|
|
|
|
|
|
# 'style' => 'field' || 'plain' |
29
|
|
|
|
|
|
|
# 'flags' => string |
30
|
|
|
|
|
|
|
# for 'field' style: flags for Word { REF ... } field, e.g. "rh" will become \r \h |
31
|
|
|
|
|
|
|
# 'prefix' => string used as prefix for bookmark name, per default empty |
32
|
|
|
|
|
|
|
# 'postfix' => string used as postfix for bookmark name, per default empty |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# |
36
|
|
|
|
|
|
|
# |
37
|
|
|
|
|
|
|
# methods |
38
|
|
|
|
|
|
|
# |
39
|
|
|
|
|
|
|
# |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub formatReference { |
42
|
|
|
|
|
|
|
# |
43
|
|
|
|
|
|
|
# return the replacement text for one reference |
44
|
|
|
|
|
|
|
# can be overwritten by subclasses |
45
|
|
|
|
|
|
|
# to implement more sophisticated styles |
46
|
|
|
|
|
|
|
# |
47
|
141
|
|
|
141
|
0
|
239
|
my ($self, $refID, $options) = @_; |
48
|
141
|
|
|
|
|
270
|
my $bookmark = $self->bookmarkID($refID); |
49
|
|
|
|
|
|
|
# print STDERR "\tID: $refID\n"; |
50
|
141
|
|
|
|
|
391
|
my $label = $self->formatLabel($refID, $options); |
51
|
|
|
|
|
|
|
# print "format ref (bkmk link): $label, $bookmark --> ", $self->outDoc(), "\n"; |
52
|
141
|
|
|
|
|
343
|
return $self->outDoc()->bookmarkLink("$label", $bookmark); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub bookmarkID { |
56
|
|
|
|
|
|
|
# strip all non-bookmark chars, and add a prefix "r" |
57
|
253
|
|
|
253
|
0
|
301
|
my ($self, $id) = @_; |
58
|
253
|
|
50
|
|
|
572
|
my $prefix = $self->option('prefix') || ""; |
59
|
253
|
|
50
|
|
|
593
|
my $postfix = $self->option('postfix') || ""; |
60
|
253
|
|
|
|
|
461
|
$id = "$prefix$id$postfix"; |
61
|
253
|
|
|
|
|
571
|
return $self->outDoc()->quoteFieldId($id); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# |
68
|
|
|
|
|
|
|
# $Log: BookmarkLink.pm,v $ |
69
|
|
|
|
|
|
|
# Revision 1.2 2002/08/08 08:27:41 Diss |
70
|
|
|
|
|
|
|
# - removed debug msg ... |
71
|
|
|
|
|
|
|
# |
72
|
|
|
|
|
|
|
# Revision 1.1 2002/03/27 10:00:52 Diss |
73
|
|
|
|
|
|
|
# new module structure, not yet included in LitRefs/LitUI (R2) |
74
|
|
|
|
|
|
|
# |
75
|
|
|
|
|
|
|
# Revision 1.1 2002/03/18 11:15:50 Diss |
76
|
|
|
|
|
|
|
# major additions: replace [] refs, generate bibliography using [{}], ... |
77
|
|
|
|
|
|
|
# |