Customizing GED2HTML with Command-Line Options

GED2HTML is a Un*x-style program whose default behavior is to read a GEDCOM file from the ``standard input,'' to create HTML files and possibly directories as output, and to write any error messages to the ``standard error output.'' The behavior of the program can be modified in various ways through the use of ``command-line options.'' Under Un*x, a program is run by typing its name, followed by a list of ``words,'' which are the arguments of the program. The Un*x convention is that command line arguments that start with ``-'' are control flags that modify the behavior of the program. Control flags can take parameters, which by convention are the words immediately following the control flag.

If you run this program under Windows (as G2H.EXE, see here for details), you can supply command line options exactly as you would under Un*x. (Note that the program does not recognize the DOS conventions of control flags starting with ``/'' and parameters specified using ``:'' after the control flag.) If you run the program under Windows, then you don't actually have a "command line" on which to specify the parameters, as it is intended that Windows programs should pop up a dialog box to obtain their parameters. To make running the program easier and less confusing for most Windows users, I have supplied the front-end program GED2HTML.EXE whose purpose is simply to pop up a dialog box, collect parameters, and start G2H.EXE with the appropriate command line. See here for a more detailed description of how to launch the program under Windows.

Here are some examples of typical command lines and their effect on GED2HTML:

Hopefully, you get the idea... Here is a list of all the options currently understood by the program:

ged2html [-Hcgiv][-d <files-per-directory>][-n <indivs-per-file>][-s <individual> ...][-f <file-template>][-t <individual-template>][-T <index-template>][-w <index-width>][[--] <gedcom-file> ...] One of the features of GED2HTML is that output processing is completely controlled by user-specifiable programs, called "templates". Templates are written in an awful programming language I designed specifically for this purpose. Default templates, for the individual index, the surname index, and for the individual data files, are preloaded into GED2HTML when it is compiled. Samples of the default templates have been provided for you in the files "index.tpl", "surname.tpl", and "indiv.tpl". If you are happy with the output produced by the default templates, there is no reason for you to change them. However, if you wish to modify the format of the output files in some way, you can use the "-T", "-S", and "-t" options to specify alternative template files. For example: ged2html -t indiv.tpl -T index.tpl myged.ged specifies that "indiv.tpl" is to be substituted for the preloaded individual template and that "index.tpl" is to be substituted for the preloaded index template file. Since these files are supposed to be identical to the preloaded ones (unless I forgot to update the samples), the command above should have the same effect as simply saying: ged2html myged.ged On the other hand, if you edit "indiv.tpl" and "index.tpl" to create files, say, "myindiv.tpl" and "myindex.tpl", then you can say: ged2html -t myindiv.tpl -T myindex.tpl myged.ged and get your own customized output. If you want to create your own templates, feel free to try it, but be forewarned that I have not made much of an attempt to make template programming "idiot proof". It is my expectation that most people will use the preloaded templates, and that if you want to make changes to the templates, you probably ought to be a programmer and you probably ought to read the output interpreter code in the file "output.c" to see exactly what the interpreter can and cannot do. Otherwise, you can just play around making changes to the template files, using the code in the samples as a guide, but I make no guarantee that the program won't crash or otherwise behave strangely if you load in a malformed template. GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu