diff --git a/doc/describe/mkgen b/doc/describe/mkgen index 828ea4f..5784e40 100755 --- a/doc/describe/mkgen +++ b/doc/describe/mkgen @@ -1,10 +1,93 @@ #! /usr/bin/perl +# This script makes the generated files used by the describe(1) web +# page. It's not pretty, but it works. +# +# Devin Reade, January 1998. +# +# $Id: mkgen,v 1.2 1998/01/17 21:27:25 gdr Exp $ +# + $gnohome_internal = "/home/gno/public_html"; $gnohome_external = "http://www.gno.org/gno"; -$basedir = "/home/gno/public_html/describe/gen"; +$gendir = "describe/gen"; # relative to $gnohome_* $entrydir = "describe/entry"; # relative to $gnohome_* +$basedir = $gnohome_internal . '/' . $gendir; + +$headinfo = + '' . "\n" . + '' . "\n". + '' + . "\n". + ''. "\n"; +$bodyinfo = + '' . "\n"; +$tailinfo = + '
' . "\n" . + 'Comments on this page should be forwarded to Devin Reade at' . "\n" . + 'gdr@eddore.myrias.com' . "\n" . + '

' . "\n" . + '' . "\n" . + 'Apple II Viewable Page' . "\n" . + '
' . "\n" . + '' . "\n" . + ''; + +$categoryMap{""} = ""; +$categoryMap{"gno/archive"} = "archive"; +$categoryMap{"gno/comm"} = "comm"; +$categoryMap{"gno/daemons"} = "daemon"; +$categoryMap{"gno/doc.utils"} = "docutil"; +$categoryMap{"gno/editors"} = "edit"; +$categoryMap{"gno/file.convert"} = "file.convert"; +$categoryMap{"gno/file.manip"} = "file.manip"; +$categoryMap{"gno/games"} = "games"; +$categoryMap{"gno/graphics"} = "graphics"; +$categoryMap{"gno/gui"} = "gui"; +$categoryMap{"gno/languages"} = "lang"; +$categoryMap{"gno/libraries"} = "lib"; +$categoryMap{"gno/mail"} = "mail"; +$categoryMap{"gno/network"} = "network"; +$categoryMap{"gno/news"} = "news"; +$categoryMap{"gno/patches"} = "patch"; +$categoryMap{"gno/programming"} = "prog"; +$categoryMap{"gno/scripting"} = "script"; +$categoryMap{"gno/shells"} = "shells"; +$categoryMap{"gno/sounds"} = "sound"; +$categoryMap{"gno/sys"} = "sys"; +$categoryMap{"gno/sysadmin"} = "sysadmin"; +$categoryMap{"gno/text.utils"} = "text"; +$categoryMap{"orca/scripting"} = "script"; +$categoryMap{"unsorted"} = "unsorted"; + +$categoryNames{"archive"} = "Archiving Utilities"; +$categoryNames{"comm"} = "Communications Utilities"; +$categoryNames{"daemon"} = "Daemons"; +$categoryNames{"docutil"} = "Documentation Utilities"; +$categoryNames{"edit"} = "Editors, Word Processors, and Document " . + "Viewers"; +$categoryNames{"file.convert"} = "File Conversion Utilities"; +$categoryNames{"file.manip"} = "File Manipulation Utilities"; +$categoryNames{"games"} = "Games"; +$categoryNames{"graphics"} = "Graphics Programs"; +$categoryNames{"gui"} = "GUI"; +$categoryNames{"lang"} = "Programming Languages"; +$categoryNames{"lib"} = "Libraries"; +$categoryNames{"mail"} = "Mail Readers"; +$categoryNames{"network"} = "Networking Utilities"; +$categoryNames{"news"} = "News Readers"; +$categoryNames{"patch"} = "Patch Programs"; +$categoryNames{"prog"} = "Programming Utilities"; +$categoryNames{"script"} = "Scripting Utilities"; +$categoryNames{"shells"} = "Shells"; +$categoryNames{"sound"} = "Sound and Music Utilities"; +$categoryNames{"sys"} = "System Utilities"; +$categoryNames{"sysadmin"} = "System Administration Utilities"; +$categoryNames{"text"} = "Text Manipulation Utilities"; +$categoryNames{"unsorted"} = "Utilities Not Yet Sorted"; while (<>) { ($name, $classes) = split; @@ -16,6 +99,7 @@ while (<>) { $currentLetter = ''; foreach $f (@sorted) { + # create the describe entry open(pp, "/usr/local/bin/describe $f|") || die ("couldn't open pipe to 'describe $f'"); @@ -23,17 +107,17 @@ foreach $f (@sorted) { open(fp2, "> $filename") || die("couldn't open $filename"); printf(fp2 "\n" . - "\n" . "\n" . - "Apple IIgs Describe Database -- " . $f . "\n" . - "\n" . + "Apple IIgs Describe Database -- %s\n" . + "%s" . "\n" . - "

Describe Entry for " . $f . "

\n" . - "
\n");
+	   "

Describe Entry for %s

\n" . + "
\n",
+	   $f, $headinfo, $f);
     while($_ = ) {
 	printf(fp2 "%s", $_);
     }
-    printf(fp2 "

\n"); + printf(fp2 "
\n%s\n", $tailinfo); close(fp2); close(pp); @@ -41,7 +125,7 @@ foreach $f (@sorted) { $l = substr($f, 0, 1); if ($l ne $currentLetter) { ($currentLetter eq '') || - (printf(fp "
\n") && close(fp)); + (printf(fp "%s\n", $tailinfo) && close(fp)); $filename = $basedir . '/' . $l . '.html'; open(fp, "> $filename") || die("couldn't open $filename"); $currentLetter = $l; @@ -49,21 +133,33 @@ foreach $f (@sorted) { $cap =~ tr/a-z/A-Z/; printf(fp "\n" . - "\n" . "\n" . - "Apple IIgs Describe Database -- Index by " . $cap . - "\n" . + "Apple IIgs Describe Database -- Index by %s\n". + "%s\n" . "\n" . - "\n" . - "

Describe Entries by Name: " . $cap . "

\n" . - "\n%s\n", $tailinfo) && close(fp)); $letters = "a b c d e f g h i j k l m n o p q r s t u v w x y z"; @letter = split(/\s+/, $letters); @@ -84,8 +180,73 @@ foreach $l (@letter) { "\n" . "

Empty Page

\n" . "There are currently no utilities registered that begin ". - "with " . $cap . ".

\n" . - "\n"); + "with " . $cap . ".

%s\n", + $tailinfo); + close(fp); + } +} + +# +# Now do them by category +# + +@catkeys = keys(%categories); +foreach $k (@catkeys) { + $file = $basedir . '/' . $k . '.html'; + open(fp, "> $basedir/$k.html") || die("could not open $basedir/$k.html"); + printf(fp + "\n" . + "\n" . + "Apple IIgs Describe Database -- By Category\n" . + "%s\n" . + "\n" . + "%s\n", + $headinfo, $bodyinfo); + if (defined($categoryNames{$k})) { + printf(fp + "

%s


\n", + $categoryNames{$k}); + } else { + printf(stderr "WARNING: No category name for \"%s\"\n", $k); + } + printf(fp "\n%s\n", $tailinfo); + close(fp); + +} + +# make category pages for which there is no entry + +@catkeys = values(%categoryMap); +foreach $k (@catkeys) { + $filename = $basedir . "/" . $k . '.html'; + if (! -f $filename) { + open(fp, ">$filename") || die("couldn't open $filename: $!"); + printf(fp + "\n" . + "\n" . + "\n" . + "Apple IIgs Describe Database -- By Category\n" . + "%s\n" . + "\n" . + "%s\n", + $headinfo, $bodyinfo); + if (defined($categoryNames{$k})) { + printf(fp + "

%s


\n", + $categoryNames{$k}); + } else { + printf(stderr "WARNING: No category name for \"%s\"\n", $k); + } + printf(fp + "There are currently no describe(1) entries in this ". + "category.\n" . + "%s\n", $tailinfo); close(fp); } }