ghgenhtml Manual
ghgenhtml is a utility in Glimpse HTTP that is usually called
through the ghreindex script (created for each archive)
that generates all the ghindex.html files.
Rarely does this script need to be invoked separately.
The ghindex.html files are the search forms used
by Glimpse HTTP to search the archive.
ghgenhtml is invoked as:
ghgenhtml <directory>
where <directory> is the root directory of the
archive.
ghgenhtml looks for the file archive.cfg in the
specified
directory. If the file exists, it is read for the archive information,
and a ghindex.html file is generated for each
subdirectory if so specified in the last field
of the archive.cfg file.
The .ghtemplate.html file
The .ghtemplate.html file is used by ghgenhtml to
create the ghindex.html files.
Basically, macro substitution is done on the .ghtemplate.html file
to generate the individual ghindex.html files.
When an archive is created using makegharc
, the template file is copied from the ghtemplate.html file
in the Glimpse HTTP binary directory (this directory is set during
installation).
The file is copied to the archive root directory, and is renamed to
.ghtemplate.html.
The ghtemplate.html file in the Glimpse HTTP binary directory
can be changed by the system administrator to
change the format of
all the default search pages for the site.
The .ghtemplate.html files in
each archive root directory can be edited to change the format of
a search page for a particular archive.
Altering a template file
There are several macros in the template files.
When ghgenhtml is run, the .ghtemplate.html file in
the archive root directory is opened, and macro substitution is done
for each macro encountered in the template file.
When a macro name is encountered in the .ghtemplate.html
file, ghgenhtml substitutes the proper field in the
resulting ghindex.html files.
In the template files, macros must be on a line of their
own. ghgenhtml looks for a line that contains the macro, and
replaces that entire line with the appropriate text.
Macro syntax
Macros must be of the form:
<!MACRO_NAME>
Where MACRO_NAME is a valid macro name. Note that there must
be a '!' before the name, as this is a valid html comment.
There cannot be any spaces anywhere in the tag. There can be
spaces before or after the macro on that line, but remember that
the entire line is replaced when the macro is replaced.
Macros include:
- GH_TITLE -- when this macro is encountered, the title of the page
is inserted. Usually used as the title of the page and as the
first line (inserted between <H1> delimiters).
- GH_DESCRIPTION -- when this macro is encountered, ghgenhtml
checks the current directory for a .description file. If such
a file exists, the text of this file is inserted here.
- GH_SEARCH -- when this macro is encountered, the Glimpse HTTP search
box is inserted. To change the format of this search box, you must
edit the ghgenhtml script.
- GH_SUBDIRS -- when this macro is encountered, a listing of the
subdirectories in the current directory
is inserted, as an unordered list (<UL>)
- GH_FILES -- when this macro is encountered, a listing of the
files in the current directory is inserted, as an unordered list (<UL>)
So to insert macro GH_TITLE, the tag:
<!GH_TITLE>
Should occur in the template file where you would like the title to appear.
Return to the Glimpse HTTP home page

Maintained by Michael Smith
glimpse@cs.arizona.edu