#!/usr/bin/perl -w
#
# build html hierarchy of pod files using pod2html
#
BEGIN{
$epath = `dirname $0`; chomp $epath;
unshift (@INC, $epath);
}
use JMtl ('line2hash', 'hash2line');
use strict 'vars';
my ($idx_header, $idx_footer);
#
# $PODROOT は CVS リポジトリの JM/pod,
# $WWWROOT は web の html コンテンツのトップ,
# $POD2HTML は pod2html コマンドを想定.
#
if (@ARGV < 3) {die "$0 srcroot destroot pod2html\n"};
my $PODROOT = $ARGV[0];
unless (-d $PODROOT) {die "$PODROOT does not exist\n"};
my $WWWROOT = $ARGV[1];
my $POD2HTML = $ARGV[2];
unless (-x $POD2HTML) {die "$POD2HTML does not executable\n"};
#
# for debugging purpose:
#
#my $PODROOT = "/home/nakano/text/JM/imp/pod";
#my $WWWROOT = "/home/nakano/public_html/JMwww/html";
#my $MAN2HTML = "/home/nakano/bin/man2html";
#my $YAMAN2HTML = "/home/nakano/text/JM/head/admin/tools/yaman2html.perl";
#
# man2html 出力に対して置換する各リンク (決め打ち(^^;)
#
my $PODWROOT='../../pod';
my $MAIN='JM Home Page';
my $CSS='';
my (%pod_hash, %page_name);
#
# $PODROOT/$pkg/translation_list の scan.
#
print "scanning translation_list's...\n";
open RL,"find $PODROOT -name translation_list|";
while(
\n/i;
# Fix double quotes
s/\`\`/\/g;
s/\'\'/\/g;
# Fix single quotes
s/\'/\/g;
# Fix em-dashes... It may not be parsed well by JP browsers.
# s/---/\/g;
# Add
/i .. /^$/) { print WL "
\n" if (/^$/); } print WL; } close P2H; close WL; system ("rm -f pod2html-*cache"); print "done.\n"; }