-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscriptlink.pl
More file actions
executable file
·53 lines (41 loc) · 869 Bytes
/
Copy pathscriptlink.pl
File metadata and controls
executable file
·53 lines (41 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /usr/bin/perl
use FindBin;
use lib "$FindBin::Bin";
use ScriptureLink;
@lines = (<>);
for (@lines) {
if (/title="q(\d+)"/) {
$n = $1;
next;
}
if (/ld4/) {
$stophere = 1;
}
if (/^\(a\)/) {
@ary = split /\s*\([a-z0-9]{1,2}\)\s*/;
$let = 'a';
for $s (@ary) {
next unless $s =~ /\S/;
#print "$let: $s\n";
@refs = ScriptureLink::ParseRefs($s);
@crefs = ScriptureLink::CondenseRefs(@refs);
$cref = join ',', @crefs;
$cref =~ s/[\s\.]//g;
$ref->{$n}->{$let} = ScriptureLink::HtmlRef($cref,"[$let]");
#print "$n,$let: $ref->{$n}->{$let}\n\n";
$let++;
}
}
}
for (@lines) {
next if /^\(a\)/;
if (/title="q(\d+)"/) {
$n = $1;
}
@lets = (/\(([a-z0-9]{1,2})\)/g);
for $let (@lets) {
$sub = $ref->{$n}->{$let};
s/\($let\)/$sub/;
}
print;
}