-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstallhtml
More file actions
executable file
·46 lines (34 loc) · 816 Bytes
/
installhtml
File metadata and controls
executable file
·46 lines (34 loc) · 816 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
#!/usr/bin/perl
use FindBin qw( $Bin );
chdir($Bin);
system 'rm -f `find website/htdocs/pod -name *.html -print`';
for my $pod (<*.pod>, <Tangram/*.pod>)
{
my $html = $pod;
$html =~ s/\.pod$/.html/;
$html =~ s:Tangram/::;
system "pod2html --infile $pod --outfile website/htdocs/pod/$html";
}
my @pods = <website/htdocs/pod/*.html>;
sub improve (&)
{
my $sub = shift;
local $/;
for my $file (@pods)
{
local *FH;
open(FH, $file) || die "Cannot open $file for reading, reason: $!";
local $_ = <FH>;
close(FH);
&$sub;
open(FH, ">$file") || die "Cannot open $file for writing, reason: $!";
print FH;
close(FH);
}
}
improve
{
s{<A HREF="/Tangram/}{<A HREF="}g;
s{<body>}{<body text=black bgcolor=lightyellow>}gi;
s{(www.tangram-persistence.org)}{<a href="http://$1"> $1 </a>}g;
};