Index: doc/tools/texi2www/texi2www =================================================================== --- doc/tools/texi2www/texi2www (revision 0a46c6dbe498883cd66140c824beb225fc60e635) +++ doc/tools/texi2www/texi2www (revision 0be992653fd08f692b68e97f446f1a3ac54b0387) @@ -20,4 +20,5 @@ where options are: -dir directory -- Specify output directory. Default is `.'. + -dirfile path -- Specifies a replacement for ../dir.html -header path -- Specifies the path to a file containing HTML; this files gets inserted near the top of each @@ -28,5 +29,6 @@ -icons path -- Specifies the path, relative to the output directory, to the arrow files. Default is `..'. - -dirfile path -- Specifies a replacement for ../dir.html + -base -- Specify the base part fo the genrated short file names + -uselongnames -- Use long names for generated html files -verbose -- Verbose output. @@ -37,13 +39,21 @@ ######################################################################## -$icons = ".."; $dir = "."; $dirfile = "../dir.html"; +%lookup = (); # clear the name mapping hash +$uselongnames=0; # default to using short names +$base = "a"; # default short name base (BASEnnnnn.html) +$outcount = 0; # count for the nnnnn part of short names +$icons = ".."; # where are the icons +$dir = "."; # where are the generated files to go +$dirfile = "../dir.html"; # "up" node pointer while ($ARGV[0] =~ /^-/) { $_ = shift; + if (/-base/) {$base = shift; next;} if (/-dirfile/) {$dirfile = shift; next;} if (/-dir/) {$_ = shift; s!/$!!; s!$!/!; $dir = $_; next;} - if (/-verbose/) {$verbose = 1; next;} if (/-footer/) {$footer = shift; next;} if (/-header/) {$header = shift; next;} if (/-icons/) {$_ = shift; s!\/$!!; $icons = $_; next;} + if (/-uselongnames/) {$uselongnames = 1; next;} + if (/-verbose/) {$verbose = 1; next;} die $usage; } @@ -103,5 +113,19 @@ } - return "$p$n.html" if ($n); + if ($uselongnames) { + return "$p$n.html" if ($n); + } else { + if ($n eq 'Top') { + $lookup{"$p$n"}= "Top.html"; + return $lookup{"$p$n"}; + } elsif ($n) { + if (! $lookup{"$p$n"}) { + $outcount = $outcount + 1; + #$lookup{"$p$n"}= "$base$outcount.html"; + $lookup{"$p$n"} = sprintf "%s%05d.html", $base, $outcount; + } + return $lookup{"$p$n"}; + } + } return ""; } # canonical @@ -776,4 +800,5 @@ &printHTML("\n") if $prev; &printHTML("\n") if $up; + &printHTML("\n") if $dirfile; &printHTML("
\n"); if ($cprev) { @@ -798,5 +823,12 @@ . "SRC=\"$icons/missing-arrow.gif\" ALT=\"next\">\n"); } - + if ($dirfile) { +# XXX need new graphic for this one + &printHTML(" \n"); + } else { + &printHTML("\n"); + } &printHTML("$title") if $title; }