1 |
|
2 |
$H2H::themepath = 'd:/home/local/h2h/H2H/';
|
3 |
require H2H;
|
4 |
require $H2H::themepath.'glossary/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.' > d:\\home\\local\\h2h\\.filelist.txt'; close A;
|
19 |
open D, '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 (/^(.+)\.hnf$/) {$prefix[3] = $1}
|
25 |
open HNF, $basepath.$_;
|
26 |
my @HNF = <HNF>;
|
27 |
$output .= &H2H::convert(\@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 |
open HTML, '> '.$output_filename; binmode HTML;
|
37 |
print HTML &H2H::Page::start($title);
|
38 |
print HTML $output;
|
39 |
print HTML &H2H::Page::end($title);
|
40 |
close HTML;
|
41 |
}
|
42 |
1;
|