$usage =<<END_OF_USAGE;
Usage: $0 --help --podpath=<name>:...:<name> --podroot=<name>
--htmldir=<name> --htmlroot=<name> --norecurse --recurse
$usage =<<END_OF_USAGE;
Usage: $0 --help --podpath=<name>:...:<name> --podroot=<name>
--htmldir=<name> --htmlroot=<name> --norecurse --recurse
+my (@libpods, @podpath, $podroot, $htmldir, $htmlroot, $recurse, @splithead,
+ @splititem, $splitpod, $verbose, $pod2html);
+
@libpods = ();
@podpath = ( "." ); # colon-separated list of directories containing .pod
# and .pm files to be converted.
@libpods = ();
@podpath = ( "." ); # colon-separated list of directories containing .pod
# and .pm files to be converted.
+# Overcome shell's p1,..,p8 limitation.
+# See vms/descrip_mms.template -> descrip.mms for invokation.
+if ( $^O eq 'VMS' ) { @ARGV = split(/\s+/,$ARGV[0]); }
+
+use vars qw( %Options );
+
# ignored in the conversion process. these are files that have been
# process by splititem or splithead and should not be converted as a
# result.
# ignored in the conversion process. these are files that have been
# process by splititem or splithead and should not be converted as a
# result.
# split pods. its important to do this before convert ANY pods because
# it may effect some of the links
# split pods. its important to do this before convert ANY pods because
# it may effect some of the links
# convert the pod pages found in @poddirs
#warn "converting files\n" if $verbose;
#warn "\@ignore\t= @ignore\n" if $verbose;
# convert the pod pages found in @poddirs
#warn "converting files\n" if $verbose;
#warn "\@ignore\t= @ignore\n" if $verbose;
installdir($dir, $recurse, $podroot, \@splitdirs, \@ignore);
}
# now go through and create master indices for each pod we split
installdir($dir, $recurse, $podroot, \@splitdirs, \@ignore);
}
# now go through and create master indices for each pod we split
print "creating index $htmldir/$dir.html\n" if $verbose;
create_index("$htmldir/$dir.html", "$htmldir/$dir");
}
print "creating index $htmldir/$dir.html\n" if $verbose;
create_index("$htmldir/$dir.html", "$htmldir/$dir");
}
$dir .= ".pod" unless $dir =~ /(\.pod|\.pm)$/;
# let pod2html create the file
runpod2html($dir, 1);
# now go through and truncate after the index
$dir =~ /^(.*?)(\.pod|\.pm)?$/sm;
$dir .= ".pod" unless $dir =~ /(\.pod|\.pm)$/;
# let pod2html create the file
runpod2html($dir, 1);
# now go through and truncate after the index
$dir =~ /^(.*?)(\.pod|\.pm)?$/sm;
print "creating index $file.html\n" if $verbose;
# read in everything until what would have been the first =head
print "creating index $file.html\n" if $verbose;
# read in everything until what would have been the first =head
open(H, "<$file.html") ||
die "$0: error opening $file.html for input: $!\n";
$/ = "";
open(H, "<$file.html") ||
die "$0: error opening $file.html for input: $!\n";
$/ = "";
while (<H>) {
last if /NAME=/;
$_ =~ s{HREF="#(.*)">}{
my $url = "$file/$1.html" ;
$url = Pod::Html::relativize_url( $url, "$file.html" )
while (<H>) {
last if /NAME=/;
$_ =~ s{HREF="#(.*)">}{
my $url = "$file/$1.html" ;
$url = Pod::Html::relativize_url( $url, "$file.html" )
# now rewrite the file
open(H, ">$file.html") ||
die "$0: error opening $file.html for output: $!\n";
# now rewrite the file
open(H, ">$file.html") ||
die "$0: error opening $file.html for output: $!\n";
- @splithead = split(",", $opt_splithead) if defined $opt_splithead;
- @splititem = split(",", $opt_splititem) if defined $opt_splititem;
- @libpods = split(",", $opt_libpods) if defined $opt_libpods;
+ @splithead = split(",", $Options{splithead}) if defined $Options{splithead};
+ @splititem = split(",", $Options{splititem}) if defined $Options{splititem};
+ @libpods = split(",", $Options{libpods}) if defined $Options{libpods};
- $htmldir = $opt_htmldir if defined $opt_htmldir;
- $htmlroot = $opt_htmlroot if defined $opt_htmlroot;
- $podroot = $opt_podroot if defined $opt_podroot;
- $splitpod = $opt_splitpod if defined $opt_splitpod;
+ $htmldir = $Options{htmldir} if defined $Options{htmldir};
+ $htmlroot = $Options{htmlroot} if defined $Options{htmlroot};
+ $podroot = $Options{podroot} if defined $Options{podroot};
+ $splitpod = $Options{splitpod} if defined $Options{splitpod};
- $recurse = $opt_recurse if defined $opt_recurse;
- $verbose = $opt_verbose if defined $opt_verbose;
+ $recurse = $Options{recurse} if defined $Options{recurse};
+ $verbose = $Options{verbose} if defined $Options{verbose};
($name) = grep(/NAME=/, @filedata);
($lcp1,$lcp2) = ($name =~ m,/H1>\s(\S+)\s[\s-]*(.*?)\s*$,sm);
if (defined $lcp1 and $lcp1 eq '<P>') { # Uninteresting. Try again.
($lcp1,$lcp2) = ($name =~ m,/H1>\s<P>\s(\S+)\s[\s-]*(.*?)\s*$,sm);
}
my $url= "$dir/$file" ;
($name) = grep(/NAME=/, @filedata);
($lcp1,$lcp2) = ($name =~ m,/H1>\s(\S+)\s[\s-]*(.*?)\s*$,sm);
if (defined $lcp1 and $lcp1 eq '<P>') { # Uninteresting. Try again.
($lcp1,$lcp2) = ($name =~ m,/H1>\s<P>\s(\S+)\s[\s-]*(.*?)\s*$,sm);
}
my $url= "$dir/$file" ;
print "splitting files by item.\n" if $verbose && $#splititem >= 0;
$pwd = getcwd();
my $splitter = absolute_path($pwd, "$splitpod/splitpod");
print "splitting files by item.\n" if $verbose && $#splititem >= 0;
$pwd = getcwd();
my $splitter = absolute_path($pwd, "$splitpod/splitpod");
# figure out the directory to split into
$pod =~ s,^([^/]*)$,/$1,;
$pod =~ m,(.*?)/(.*?)(\.pod)?$,;
# figure out the directory to split into
$pod =~ s,^([^/]*)$,/$1,;
$pod =~ m,(.*?)/(.*?)(\.pod)?$,;
# create a directory of a similar name and store all the
# files in there
$pod =~ s,.*/(.*),$1,; # get the last part of the name
# create a directory of a similar name and store all the
# files in there
$pod =~ s,.*/(.*),$1,; # get the last part of the name
$dir =~ s/\.pod//g;
push(@$splitdirs, "$poddir/$dir");
mkdir("$poddir/$dir", 0755) ||
$dir =~ s/\.pod//g;
push(@$splitdirs, "$poddir/$dir");
mkdir("$poddir/$dir", 0755) ||
# check if we should ignore it.
next if grep($_ eq "$podroot/$pod.pod", @$ignore);
# check if we should ignore it.
next if grep($_ eq "$podroot/$pod.pod", @$ignore);
# check if we should ignore it.
next if grep($_ eq "$pm.pm", @ignore);
# check if we should ignore it.
next if grep($_ eq "$pm.pm", @ignore);
"--htmlroot=$htmlroot",
"--podpath=".join(":", @podpath),
"--podroot=$podroot", "--netscape",
"--htmlroot=$htmlroot",
"--podpath=".join(":", @podpath),
"--podroot=$podroot", "--netscape",
($doindex ? "--index" : "--noindex"),
"--" . ($recurse ? "" : "no") . "recurse",
($#libpods >= 0) ? "--libpods=" . join(":", @libpods) : "",
($doindex ? "--index" : "--noindex"),
"--" . ($recurse ? "" : "no") . "recurse",
($#libpods >= 0) ? "--libpods=" . join(":", @libpods) : "",