}
}
-sub startBody {
+sub startHead {
my $out = shift;
my $title = shift;
print $out "<!DOCTYPE html>
<html><head>
<title>$title</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
-</head><body>";
+";
}
sub htmlescape {
}
use File::Spec;
+use File::Basename;
sub genHTML {
my $out = shift;
push @rels, $rel;
}
}
- startBody $out, $page;
- print $out "<pre>\n";
+ startHead $out, $page;
+ {
+ my $fn = basename $page;
+ print $out "<link rel=\"alternate\" type=\"text/plain\" title=\"plain\"
+ href=\"$fn.txt\" />\n";
+ }
+ print $out "</head><body><pre>";
open(my $fh, "<", $page) or die "$!";
while (<$fh>) {
chop;
sub genIndex {
my $out = shift;
my $page = shift;
- startBody $out, "$page/";
- print $out "<table border=1>\n";
+ startHead $out, "$page/";
+ print $out "</head><body><table border=1>\n";
my @lnks = sort @{$cats{$page}};
foreach my $l (@lnks) {
next if $l =~ /\/$/;
close $fh;
@s = stat($pth) or die "$!";
utime $s[9], $s[9], "$ARGV[1]/$pth.html";
+ open(my $in, "<", $pth) or die "$!";
+ open(my $out, ">", "$ARGV[1]/$pth.txt") or die "$!";
+ while (<$in>) { print $out $_ };
+ close $out;
+ close $in;
+ utime $s[9], $s[9], "$ARGV[1]/$pth.txt";
}
} elsif ($ARGV[0] eq "dot") {
print "digraph d {\n";