1 |
|
2 |
$H2H::themepath = '/home/local/h2h/H2H/';
|
3 |
require H2H;
|
4 |
require $H2H::themepath.'general/theme.ph';
|
5 |
|
6 |
my ($basepath,$output_filename) = @main::ARGV;
|
7 |
exit unless $basepath;
|
8 |
$basepath =~ tr#/#\\#;
|
9 |
$basepath.= '\\' unless substr($basepath,-1) eq '\\';
|
10 |
$H2H::Page::basepath = $main::ARGV[2];
|
11 |
|
12 |
$hnffiles = '*.hnf';
|
13 |
unless ($output_filename) {
|
14 |
my $path = substr($basepath, 0, length($basepath) - 1);
|
15 |
$output_filename = $path.'.ja.html';
|
16 |
}
|
17 |
|
18 |
open A, '| dir /B '.$basepath.$hnffiles.' > \\home\\local\\h2h\\.filelist.txt'; close A;
|
19 |
open D, '\\home\\local\\h2h\\.filelist.txt'; @FILELIST = <D>; close D;
|
20 |
|
21 |
my $output;@FILELIST = sort {$a cmp $b} @FILELIST;
|
22 |
|
23 |
for (@FILELIST) { chop;
|
24 |
my @prefix; if (/^(?:s\d+-)?(.+)\.hnf$/) {$prefix[3] = $1}
|
25 |
open HNF, $basepath.$_;
|
26 |
my @HNF = <HNF>;
|
27 |
$output .= &H2H::h2h(undef, \@prefix, @HNF);
|
28 |
close HNF;
|
29 |
}
|
30 |
|
31 |
if ($output) {
|
32 |
my $title;
|
33 |
if (-e $basepath.'.header') {$H2H::Template::header = $basepath.'.header'}
|
34 |
if (-e $basepath.'.footer') {$H2H::Template::footer = $basepath.'.footer'}
|
35 |
if(-e $basepath.'.title'){open T,$basepath.'.title';while(<T>){$title.=$_}close T}
|
36 |
require '/home/suika/lib/jcode.pl';
|
37 |
my $s = &H2H::Page::start($title).$output.&H2H::Page::end($title);
|
38 |
jcode::convert(\$s, 'jis', 'euc');
|
39 |
open HTML, '> '.$output_filename; binmode HTML;
|
40 |
print HTML $s;
|
41 |
close HTML;
|
42 |
}
|
43 |
1;
|