summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-03 16:05:16 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-03 16:05:16 +0000
commit05862b4846b3aa007a891bcb0650086b7efad3c6 (patch)
tree8b9bffd2ae2eb7cf44851428d0d97204135cb84a
parentAdded fourth icon which takes user back to the index (diff)
downloadrtems-05862b4846b3aa007a891bcb0650086b7efad3c6.tar.bz2
Added shortname generation support with the capability for the user
to specify the base of the name. BASEnnnn.html
-rwxr-xr-xdoc/tools/texi2www/texi2www42
1 files changed, 37 insertions, 5 deletions
diff --git a/doc/tools/texi2www/texi2www b/doc/tools/texi2www/texi2www
index a77bbe6ac2..f03949f814 100755
--- a/doc/tools/texi2www/texi2www
+++ b/doc/tools/texi2www/texi2www
@@ -19,6 +19,7 @@ $usage = <<EOT;
Usage: texi2www [option ...] texinfo_file
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
generated HTML file.
@@ -27,7 +28,8 @@ where options are:
generated HTML file.
-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.
The complete user\'s is available at
@@ -36,15 +38,23 @@ EOT
########################################################################
-$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;
}
@@ -102,7 +112,21 @@ sub canonical # (node_name)
$n = $1 . sprintf("\$%02x",ord($2)) . $3;
}
- 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
@@ -775,6 +799,7 @@ sub print_arrows
&printHTML("<LINK REL=\"Precedes\" HREF=\"$cnext\">\n") if $next;
&printHTML("<LINK REV=\"Precedes\" HREF=\"$cprev\">\n") if $prev;
&printHTML("<LINK REV=\"Subdocument\" HREF=\"$cup\">\n") if $up;
+ &printHTML("<LINK REV=\"Library\" HREF=\"$dirfile\">\n") if $dirfile;
&printHTML("</HEAD><BODY><P>\n");
if ($cprev) {
&printHTML("<A HREF=\"$cprev\"><IMG ALIGN=MIDDLE "
@@ -797,7 +822,14 @@ sub print_arrows
&printHTML("<A><IMG ALIGN=MIDDLE "
. "SRC=\"$icons/missing-arrow.gif\" ALT=\"next\"></A>\n");
}
-
+ if ($dirfile) {
+# XXX need new graphic for this one
+ &printHTML("<A HREF=\"$dirfile\"> <IMG ALIGN=MIDDLE "
+ . "SRC=\"$icons/dir-arrow.gif\" ALT=\"Bookshelf\"></A>\n");
+ } else {
+ &printHTML("<A><IMG ALIGN=MIDDLE "
+ . "SRC=\"$icons/missing-arrow.gif\" ALT=\"Bookshelf\"></A>\n");
+ }
&printHTML("<CITE>$title</CITE>") if $title;
}