2 #################################################
3 #pnuts version 0.4 part of the WN server package
4 #################################################
5 # for more info, see http://hopf.math.nwu.edu/docs/utility.html#pnuts
6 # Modified by Stefan Kramer for use with Pine Technical Notes
7 # Last modified on 1995 Nov. 02
12 # Edit to specify what should appear as text of navigation bar. Note:
13 # If the HTML files processed by PNUTS will be converted to plain-text files,
14 # the PNUTS-generated link text will probably be stripped out, so this
15 # text should be unique (i.e., not expected to occur elsewhere in text).
17 # This is the original link appearance, without graphic buttons
18 # $prevw="<b>Previous</b>";
19 # $nextw="<b>Next</b>";
20 # $upw="<b>Up one level</b>";
21 # $topw="<b>Table of Contents</b>";
22 # $searchw="<b>Search</b>";
23 # $indexw="<b>Index</b>";
25 $prevw='<IMG SRC="../graphics/BPprev.gif" ALT="[Previous]">';
26 $nextw='<IMG SRC="../graphics/BPnext.gif" ALT="[Next]">';
27 $upw=''; # not needed and don't have a graphic for UP
28 $topw='<IMG SRC="../graphics/BPtoc.gif" ALT="[Table of Contents]">';
29 $searchw='<IMG SRC="../graphics/BPsearch.gif" ALT="[Search]">';
30 $indexw=''; # no index here and no graphic for it
37 $search = $opt_s if $opt_s ne "";
38 $index = $opt_i if $opt_i ne "";
41 $marker = "<!-- pnuts -->";
44 open( LIST
, "<$file") || die "Can't open file: $!";
52 while ( &getnextfile
() ) {
53 $curcopy = $currentfile."~";
55 rename( $currentfile, $curcopy)
56 || die "Can't rename file: $currentfile";
57 open( OLDCURR
, "<$curcopy" ) || die "Can't open file: $!";
58 open( NEWCURR
, ">$currentfile" ) || die "Can't open file: $!";
59 while ( $line = <OLDCURR
>) {
60 if ( $line =~ "^$marker") {
76 printf( NEWCURR
"$marker");
77 printf( NEWCURR
"<P><HR>");
79 printf( NEWCURR
" <a href=\"%s\">$prevw</a>", $previous);
82 printf( NEWCURR
" <a href=\"%s\">$nextw</a>", $nextfile);
84 if ( $up[$curlevel - 1] ) {
85 printf( NEWCURR
" <a href=\"%s\">$upw</a>",
88 if ( $top && ( $top ne $currentfile) ) {
89 printf( NEWCURR
" <a href=\"%s\">$topw</a>", $top);
92 printf( NEWCURR
" <a href=\"%s\">$searchw</a>", $search);
95 printf( NEWCURR
" <a href=\"%s\">$indexw</a>", $index);
97 printf( NEWCURR
"\n");
101 if ( $nextfile eq "") {
104 $previous = $currentfile;
105 $up[$curlevel] = $currentfile;
107 $currentfile = $nextfile;
109 ($nextfile = <LIST
>) || ($nextfile = "");
110 $nextfile =~ s/(\t*)//;
111 last if $nextfile eq "";
114 if ( -d
$nextfile ) {
115 print "$nextfile is directory, ignoring it\n";
120 $curlevel = $nextlevel;
121 $nextlevel = length( $1);