GED2HTML: A GEDCOM to HTML Translator

Eugene W. Stark

NOTE: This software and associated documentation are
Copyright © 1995 Eugene W. Stark.
See here for information on copying. Versions 2.4 and higher are shareware. Please read here to find out how to register your copy.

Overview

GED2HTML is a program that inputs genealogical data in GEDCOM format, and outputs a collection of HTML files suitable for presentation on the World Wide Web. The input format it accepts is based on the GEDCOM 5.3 draft standard, with some variations to accomodate ideosyncrasies of existing genealogy programs. The output produced consists of HTML files containing the individual data, an index suitable for quickly locating an individual by name, an auxiliary surname index with links to the first individual with each surname, and a special index file suitable for use by automatic indexing programs such as the Experimental GenWeb Index . The output is highly configurable. Each data file can contain a single individual or multiple individuals. Either a hierarchical or a flat index can be specified. Files can be organized into subdirectories or a flat collection. In addition, the HTML output is template-driven, so that the format of the HTML files can be changed by the user.

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
GED2HTML: Copyright and License Information

Copyright and License Information

NOTE: This software program and associated documentation are
Copyright © 1995 Eugene W. Stark.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement:
    This product includes software developed by Eugene W. Stark.
  4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
  5. No copying or redistribution in any form for commercial purposes is permitted without specific prior written permission.
  6. This software may be used, for evaluation purposes only, for a period of no more than fourteen days. Use of the software for a period beyond fourteen days, or use of the software for anything other than evaluation purposes, requires written permission from the author. Such permission may be obtained by paying to the author a registration fee, as described in the documentation accompanying this software.

THIS SOFTWARE IS PROVIDED BY EUGENE W. STARK (THE AUTHOR) ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

GED2HTML home page

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

Registration

This is copyrighted software. You are encouraged to copy and share this software, subject to the specific conditions detailed here. You are permitted to evaluate this software free of charge for a period of no more than fourteen days. To use this software for longer than fourteen days, or to use it for anything other than evaluation purposes, requires written permission from the author. Such permission may be obtained by paying to the author a registration fee.

To pay the registration fee, please send a check or money order for $20 US currency to:

Eugene W. Stark
14 Landing Lane
Port Jefferson, NY 11777
USA
When I receive your registration fee, I will send you an acknowledgement of your registration, and place you on a mailing list to receive announcements of future updates to the program. Your registration fee entitles you to use any updated version of the program I release within two years of receiving your fee. Your registration fee helps me to justify spending time improving this program and responding to E-mail from users. Thanks!

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
GED2HTML: About the Program

GED2HTML: About the Program

This program reads GEDCOM files as input and produces a set of HTML files, each file containing information from one or more individual records in the GEDCOM input. The information for each individual contains hypertext links (relative URL's) to the files for the parents, spouses, and children for that individual. Birth, marriage, and death events are included in the file, as are notes records associated with the individual, and source information. A sorted, hierarchical index can also be created, with a hypertext link to each individual. The program can be instructed to include ``pedigree charts'' with each individual, to facilitate navigation between individuals. The program can also automatically insert additional HTML text into each individual file. This feature can be used add additional text, images, audio, or whatever else you want to each individual. Moreover, you only have to create the ``include files'' for the individuals on which you have extra information, and you can maintain all your other data on whatever system you are using to produce the GEDCOM output. If you get an updated GEDCOM file, simply go to the directory where the individual ``include files'' are stored and run ``ged2html'' again. It will update each individual file with the new GEDCOM data and will automatically insert the additional HTML text from the ``include'' files" again.

I originally wrote this program because I tried the GEDCOM to HTML translator posted by Frode Kvam (frode@ifi.unit.no), and found it insufficiently flexible. Since his program only parsed a limited portion of the GEDCOM file, not including notes records, there wasn't an easy way to modify it to get all my notes into the output files. So, I decided to write a YACC-based parser for the GEDCOM standard, and to base the translator on that. The YACC parser was used in Version 1 of my program, however as I got more experience with the GEDCOM standard and how it is actually used in practice, I decided that it was too difficult to make the YACC-based parser accept the full variety of GEDCOM's that actually exist. So, for Version 2 I rewrote the parser so that it will accept essentially ``any'' GEDCOM file, and will only complain about grossly malformed input.

Since Version 2.0 many people have used this program to place their family history databases on the World Wide Web. Small GEDCOM's of under 1000 individuals are processed into HTML by GED2HTML in a few seconds on a modern PC running Un*x (processing is somewhat slower under Windows due to the more inefficient filesystem). However, on a system with sufficient swap space and main memory, much larger GEDCOM's can be processed. The program has processed databases of well over 100,000 lines of GEDCOM and 10,000 individuals under both Un*x and Windows. The program is capable of processing all the GEDCOM's on Yvon Cyr's Acadian/French Canadian CD-ROM. The largest database I have attempted is the file ``t-roux.ged'' on that CD-ROM, which is a 5478458 byte, 214266 line GEDCOM file containing 15472 individuals and 7012 families. On my system (486/33 with 16MB RAM and IDE disks, running the FreeBSD 2.0.5 operating system), it took roughly 35 minutes to process this file, of which under five minutes were spent reading the file and constructing the database, and the remainder was spent in outputting 1548 HTML files of individual data, 10 individuals per file, organized into 31 directories, a three-level hierarchical index consisting of 574 HTML files, and a surname index in a single HTML file. The HTML output files consumed 18738K of disk space. The processing itself required 32MB of virtual memory.

I have used this program to prepare my own data for presentation on the World-Wide Web. You can view this data by starting from here. I preprocessed my GEDCOM file to produce approximately 700 individual files, which are linked together between themselves and to my hypertext family history document. Birger Wathne (Birger.Wathne@vest.sdata.no) and others have used various versions of this program in various demonstrations of genealogy over the World-Wide Web. Some of these demonstrations do not preprocess the data into HTML files, but rather use LifeLines to manage the database in GEDCOM format, and ged2html to process the output of queries for presentation over the Web. However, at present most people are using this program as a ``black box'' for quickly transforming their GEDCOM data into a form suitable for presentation on the World Wide Web. A good starting point for finding many of these databases is Tim Doyle's home page.

I have developed and run this program on an Intel 486DX/33 under the FreeBSD operating system. If you are using another flavor of Un*x, you shouldn't have too much trouble getting it to run. You do need an ANSI C compiler (like GCC), as I am no longer interested in writing old-style C. I have also compiled the program for Windows using Microsoft Visual C/C++ 1.0. Most of the people presently using the program are using the Windows version.

The GEDCOM parser in the program is built around the GEDCOM 5.3 standard. Whereas version 1 of this program checked the GEDCOM input fairly stringently for conformance to the standard, the current version attempts to make sense out of anything that looks remotely like a GEDCOM file. It will complain about grossly malformed GEDCOM files, but it still tries to get through to the end and produce whatever output it can.

The output processor is template-driven. That is, it consists of an interpreter for a simple macro language, which produces output files by processing template strings and filling in information from the GEDCOM database. The template-driven output scheme was used to obtain flexibility and language independence. The default templates use the cross-reference ID's in the GEDCOM file to name the HTML files, and will insert one ``image'' file (if it exists) near the beginning of each individual file and one ``additional information'' file (if it exists) at the end of each individual file. For example, an individual with cross-reference ID ``I101'' would receive an HTML file ``I101.html''. As this file is created, the file ``I101.img'' (intended to be used to insert an image of the person) would be inserted near the beginning, and the file ``I101.inc'' would be inserted at the end (intended to be used to insert arbitrary additional material). Default templates are compiled into the program, and they will be used unless you specify an alternative template using the appropriate command-line argument.

Though versions 2.3a and earlier of this program were released as freeware, since Version 2.3a I have started to spend quite a bit of time responding to E-mail from users of the program. From the E-mail correspondence, it became clear that much better documentation was required. Also, the program itself has grown, and revisions are starting to take more time. In addition, I have begun running an Experimental GenWeb Index site on the World Wide Web to try to establish a central index of as much of the data that was prepared using GED2HTML program (and other compatible software) as I could. To justify the amount of time I am spending on this work, I decided to make the current and future versions of the program shareware.

THANKS: go to Birger Wathne for contributing useful ideas and code for the first versions of this program, and to a number of other users (including, but not limited to, Annelise Anderson, Allyn Brosz, Susie and Kerry Jane Dunavant, Bob Fieg, W. Wesley Groleau, Brian Mavrogeorge, Steve Messinger, Mike Schwitzgebel, and Doug Smith) of various versions of the program who took the trouble to send me their bug reports and problematic GEDCOMS as well everyone else who sent kind words that make all the work I did on this program worthwhile.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
GED2HTML: Current Version GED2HTML v2.4 (11/5/95) by Gene Stark (stark@cs.sunysb.edu) GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
GED2HTML: Downloading the Program

GED2HTML: Downloading the Program

There are two versions: a Windows version (binary only) and a Unix version (with sources). Both are shareware, see here to find out how to register your copy.

You will always be able to find your way to the current version of the program by starting here. The links below, though current at the time this was written, might become outdated due to network reconfiguration underway at our site.

Sorry, there isn't currently any Macintosh version, nor do I have any plans to port the program to that platform, since I don't really have easy access to a Macintosh.

If you are using Windows, you may also need or want the following utilities.

NOTE: I didn't write these utilities, I just retrieved them from public network sites and put them here as a convenience. Please don't mail me about bugs or problems with these programs.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
GED2HTML: Running the Program

GED2HTML: Running the Program

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Compiling and Running the Un*x Version of GED2HTML

Compiling and Running the Un*x Version of GED2HTML

The Un*x distribution of GED2HTML is a source distribution. You must first download the distribution file. The distribution file is a gzipped tar file, so you will also need ``gunzip'' and ``tar'' (standard tools available on most systems and on the net) to unpack the distribution. You will also need ``make'' (also a standard tool) and an ANSI C compiler (such as ``gcc'') to build the program. An old-style C compiler such as that supplied with SunOS will not compile the program, sorry.

After downloading, you should have a file ``ged2html-vvvv.tar.gz'', where the ``vvvv'' represents the version number of the distribution. First, uncompress it using the command:

gunzip ged2html-vvvv.tar.gz Make a subdirectory ``ged2html'' (call it whatever you want) into which to unpack the distribution. Go to that directory and execute: tar xvf ../ged2html-vvvv.tar

At this point, you should have a number of files, including ``Makefile'', and C sources and header files. Compile the program by typing:

make If all is well, you should then have an executable file ``ged2html'' in the current directory.

Ged2html is invoked, as are all Un*x commands, by typing its name, possibly followed by command-line arguments. Ged2html can receive its GEDCOM input in one of two ways. If a series of filename arguments are supplied on the command line, then it reads GEDCOM from them, one after the other. If it is invoked without filename arguments on the command line, then it reads GEDCOM from the standard input.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Running GED2HTML the Simplest Way

Running GED2HTML the Simplest Way

The simplest way to run GED2HTML is with a command like the following: ged2html yourgedcom.ged The output of GED2HTML is created in the current directory.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Supplying Options to GED2HTML

Supplying Options to GED2HTML

If you don't like some aspect of the output of GED2HTML.EXE, it can probably be changed. There is one easy form of output customization you can do without supplying any options whatsoever, and this is to include additional HTML text at two fixed points in the individual files. How to do this is described here.

To make more complicated changes to the output format, you will need to supply ``command-line options'' to the program when it is run, you will need to supply command-line options to the program when it is run. This is done in the usual Un*x fashion. The available options are described here. The HTML output of the program can also be customized through the use of output templates, which are described here.

GED2HTML home page

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

Commonly Encounted Problems

Q: When I try to compile the program, I get millions of syntax errors. What is wrong? [Answer]

Q: When I link the program, I get a message ``Undefined symbol _fgetln''. What is wrong? [Answer]

Q: When I link the program, I get a message ``Undefined symbol _strdup''. What is wrong? [Answer]

Q: When compiling tags.c, the compiler complains about incompatible types at the line containing ``bsearch()''. What should I do? [Answer]

Q: When compiling main.c, the compiler complains about SEEK_END being undefined. What should I do? [Answer]

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Solutions to Commonly Encounted Problems

Solutions to Commonly Encounted Problems

Q: When I try to compile the program, I get millions of syntax errors. What is wrong?

A: You are trying to compile the program with a pre-ANSI C compiler. It cannot understand ANSI function prototypes. Get an ANSI C compiler, such as gcc, and use that.

Q: When I link the program, I get a message ``Undefined symbol _fgetln''. What is wrong?

A: You are running on an older or non-BSD version of Un*x that does not have the ``fgetln()'' function. I actually wrote my own implementation of fgetln() and put it in the code, but it is #ifdef'ed out because I would rather use a library version if it exists. Edit the Makefile and delete the ``-DHAVE_FGETLN'' from the ``CFLAGS'' line. Then re-run ``make''.

Q: When I link the program, I get a message ``Undefined symbol _strdup''. What is wrong?

A: You are running on a version of Un*x that does not have the ``strdup()'' function. There is code for it, but it is #ifdef'ed out because I would rather use a library version if it exists. Edit the Makefile and delete the ``-DHAVE_STRDUP'' from the ``CFLAGS'' line. Then re-run ``make''.

Q: When compiling tags.c, the compiler complains about incompatible types at the line containing ``bsearch()''. What should I do?

A: It may be necessary to place the cast (struct tag *) in front of the call to bsearch() in tags.c, or possibly to change the cast on the function argument to bsearch to make the compiler happy. This is not necessary with gcc, and it is my belief that it should not be necessary under ANSI C.

Q: When compiling main.c, the compiler complains about SEEK_END being undefined. What should I do?

A: Some people have found that they need to #include <unistd.h> in main.c. My belief is that ANSI C dictates that the constant SEEK_END should be in <stdlib.h>. If you are having this problem, try #include'ing <unistd.h> too.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Uploading the Output of GED2HTML

Uploading the Output of GED2HTML

When ged2html runs successfully, it places a number of files and subdirectories in the current directory. You will want to upload this entire subtree, without modification, to your Web service provider. One way to do this is to use the ``tar'' program (standard Un*x utility) to package up the entire subtree into a single file that can be uploaded and then unpacked on your service provider's system. Use the command: tar cvf html.tar * to create a binary file ``html.tar'' containing the entire contents of the subtree headed by the current directory. On your service provider's system (usually a Un*x system), go to where you want to unpack the files and type: tar xvf html.tar

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Running the Windows Version of GED2HTML

Running the Windows Version of GED2HTML

The Windows version of GED2HTML is distributed as a file GED2HTML.ZIP. If you don't yet have this file, you first have to download it. Also, to unpack the distribution you will need a recent copy of PKUNZIP.EXE. If you don't have one, be sure to download that, too.

After downloading, you should have a file GED2HTML.ZIP. Make a subdirectory GED2HTML (call it whatever you want) in which to unpack the program. Go to that directory and execute:

PKUNZIP ..\GED2HTML.ZIP At this point, you should have a number of files, including GED2HTML.EXE and G2H.EXE. The file GED2HTML.EXE is the Windows user interface, which is what most people probably want to run. This user interface simply collects your options in a dialog box, and then starts G2H.EXE, which is the program that does the real work. Most (but not all) of the options understood by G2H.EXE can be accessed from the Windows user interface. GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Running GED2HTML the Simplest Way

Running GED2HTML the Simplest Way

The simplest way to run GED2HTML is as follows:
  1. From the file manager, go to the directory that contains GED2HTML.EXE and G2H.EXE.
  2. Double click on the icon representing GED2HTML.EXE. A dialog box will pop up.
  3. Enter the name of the GEDCOM file to be processed in the space provided. Use a full path if the file is not in the same directory as where GED2HTML.EXE and G2H.EXE are located. Select other options as desired. For a description of the available options and their effect on the output, see here.
  4. Press OK. The dialog box will disappear and G2H.EXE will be started with the options you selected. When processing is completed, the word ``FINISHED'' will appear in the lower left-hand corner of the window.
  5. The output of G2H.EXE is placed in a subdirectory ``HTML'' of the directory from which it is run. With your Web browser, peruse the output (start with ``PERSONS.HTM'') to make sure that it is OK.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Runnning G2H.EXE Directly

Running G2H.EXE Directly

If you don't like some aspect of the HTML output produced by GED2HTML, it can probably be changed. There is one easy form of output customization you can do without supplying any options whatsoever, and this is to include additional HTML text at two fixed points in the individual files. How to do this is described here.

To make more complicated changes to the output format, you will need to supply optional configuration parameters to the program when it is run. Most of these parameters are accessible from GED2HTML.EXE, the Windows user interface. However, for the few parameters that are not accessible through the user interface, you will need to run G2H.EXE directly, and supply it with ``command-line options.'' This is done as follows:

  1. Place the GEDCOM file you wish to process in the same subdirectory that contains the G2H.EXE file.
  2. Go to the File Manager window, and select the subdirectory that contains the G2H.EXE file and the GEDCOM file to be processed.
  3. Single-click on the icon representing G2H.EXE to cause it to be selected.
  4. From the File Manager Menu bar, select the ``Run'' item. A window should pop up asking if you want to run G2H.EXE with a particular command line.
  5. Edit the command line to include the particular option flags you want. The available options are described here.
  6. Start G2H.EXE by pressing the appropriate button.
  7. The output of G2H.EXE is placed in a subdirectory ``HTML'' of the directory from which it is run. With your Web browser, peruse the output (start with ``PERSONS.HTM'') to make sure that it is OK.
The HTML output of the program can also be customized through the use of output templates, which are described here.

GED2HTML home page

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

Commonly Encounted Problems

Q: I can't figure out how to run the program. When I try to run GED2HTML.EXE, a window pops up with a message I can't understand and it just sits there. [Answer]

Q: Everything looks fine on my PC, but when I upload the files to my Web service provider, all the HTML files have suffix ``.htm'' and Netscape doesn't seem to interpret them as HTML files. [Answer]

Q: How can I create all the output files so that their names end in ``.html'', rather than ``.htm''. [Answer]

Q: How can I cause all the HTML files to be generated so that the links in all the individual files specify filenames ending in ``.html'', rather than ``.htm''? [Answer]

Q: After I upload all the HTML files to my Web service provider, none of the links work, because the file names are all in lower case, but the links specify the file names in upper case. [Answer]

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Solutions to Commonly Encounted Problems

Solutions to Commonly Encounted Problems

Q: I can't figure out how to run the program. When I try to run GED2HTML.EXE, a window pops up with a message I can't understand and it just sits there.

A: The current version of GED2HTML.EXE does not have a true Windows front-end, and needs to be launched from the File Manager. See here for the simplest way to do it.

Q: Everything looks fine on my PC, but when I upload the files to my Web service provider, all the HTML files have suffix ``.htm'' and Netscape doesn't seem to interpret them as HTML files.

A: This is a somewhat technical problem. The easiest solution requires the cooperation of your Web service provider. Web servers generally have a ``mime.types'' configuration file, which lists mappings from filename suffixes to MIME types. This information allows the server to determine what kind of information is in a file by looking at the suffix. The server communicates this information to your browser when the file is retrieved, and the browser, in turn, uses the information to control how the file is displayed. Some servers lack an entry:

text/HTML htm in this file, which would tell them that files ending in ``.htm'' are to be interpreted as HTML source. Your files all end in ``.htm'' because they were created under DOS, and DOS only supports three-letter filename suffixes. It is not sufficient to change the names of all the files to end in ``.html'', because then the names won't match all the links in each of the files. What you need to do is to ask your friendly Web service provider to add the above entry to the server ``mime.types'' configuration file. Usually they will agree to do this for you, as it doesn't have any bad effect, and it will generally help out DOS users who are uploading HTML from their PC's.

Q: How can I create all the output files so that their names end in ``.html'', rather than ``.htm''.

A: You can't, at least not on pre-Windows 95 systems. The reason is that DOS only supports three-letter filename suffixes, and will truncate anything longer than that. It might be possible to have longer suffixes on Windows 95. I don't know because I don't have Windows 95. Try using the ``-f'' option to GED2HTML.EXE to specify an alternate filename template string. See here for more details on how to supply options.

Q: How can I cause all the HTML files to be generated so that the links in all the individual files specify filenames ending in ``.html'', rather than ``.htm''?

A: To do this, you need to use the ``-t'', ``-T'', and ``-S'' options to GED2HTML.EXE to cause it to use the sample output template files INDIV.TPL, INDEX.TPL, and SURNAME.TPL, supplied with the distribution, rather than the compiled-in output templates. See here for more details on how to supply options.

Q: After I upload all the HTML files to my Web service provider, none of the links work, because the file names are all in lower case, but the links specify the file names in upper case.

A: You need to use different program that uploads your HTML files without changing their names to lower case. See here for a suggestion.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Uploading the Output of GED2HTML.EXE

Uploading the Output of GED2HTML.EXE

When GED2HTML.EXE runs successfully, it creates a subdirectory ``HTML'' into which it places a number of other files and subdirectories. You will want to upload this entire subtree, without modification, to your Web service provider. One way to do this is to use the TAR.EXE program (available here) to package up the entire subtree into a single file that can be uploaded and then unpacked on your service provider's system. Use the command: TAR cvf HTML.TAR HTML (note that the ``cvf'' must be in lower-case letters) to create a binary file ``HTML.TAR'' containing the contents of the entire ``HTML'' subtree. On your service provider's system (usually a Un*x system), execute: tar xvf html.tar to unpack the file and recreate the ``HTML'' subtree. Note that if you packaged up your data as suggested above, then when you unpack your data, the ``HTML'' directory will be created in the directory from which you run ``tar''. Thus, you want to make sure you are in the directory where you want the ``HTML'' subdirectory to go before you unpack your data.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Output Files Produced by GED2HTML

Output Files Produced by GED2HTML

GED2HTML produces a number of output files and subdirectories. Under Un*x, output files and subdirectories are created in the directory from which GED2HTML is run. Under Windows, a subdirectory ``HTML'' is created, and the output files and subdirectories are placed there. The following is a description of the various output files and directories produced by GED2HTML: GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Customizing GED2HTML with Command-Line Options

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
Including HTML Code Inline

Including HTML Code Inline

The standard output templates compiled into GED2HTML provide for inlining arbitrary HTML code at two standard positions in the page for each individual. The first place occurs just after the name of the individual, and it is intended (though not required) that it be used to insert an image of the individual. When the program is run, as it processes each individual, it looks in the directory from which it was started for a file ``xxxxx.img'', where ``xxxxx'' is the cross-reference ID of the individual being processed. If found, the ``xxxxx.img'' file is inserted verbatim into the output stream. For this to be useful, you should put HTML code in that file; for example, an anchor that links to an image file.

The second place where HTML code is inserted verbatim is at the end of the information for each individual. At this point, the program looks for a file ``xxxxx.inc''. It is intended (though again not required), that this file would include any additional notes or information about this person not present in the original GEDCOM file. For example, I have used this in my hypertext family history document to link to things like wills and divorce records.

If you write your own output templates, you can arrange for inlining anything you want, using the same mechanism as is used by the default templates. For more information on output templates, see here.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
Customizing GED2HTML with Output Templates

Customizing GED2HTML with Output Templates

One of the features of GED2HTML is that output processing is completely controlled by user-specifiable programs, called ``templates.'' Templates are written in a truly awful programming language I designed specifically for this purpose. To tell the truth, it was designed more for ease of interpretation than for ease of programming, and it shows. 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 templates (the defaults used in the Un*x version of the program) 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'', ``-t'', and ``-R'' 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 specify a `-' instead of the name of a template file, for example: ged2html -t - the program will output the compiled-in default version of that template file on the standard 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.'' Even I only modify the templates with a debugger close at hand. 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'' (in the Un*x distribution) 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.

If you are really convinced that you want to make your own templates, first have a look at the files ``indiv.tpl'', ``index.tpl'', and ``surname.tpl''. These use most, if not all, the available constructs in the output language. A template file consists of text interspersed with variable references and control commands. Variable references start with ``$'', and are used to insert in-line information from the GEDCOM database. Constructs that can appear in variables are as follows:

Control constructs are signalled by a "!" appearing at the beginning of a template line. Conditional execution uses the following control constructs:

These provide for conditional output based on whether particular fields in the database have non-null values. Looping constructs are the following: These constructs provide for repetitive output of a particular section of the template, based on what is in the database. For example, it can be used to iterate over all the marriages of a particular individual. In both the !IF and !WHILE constructs, the "condition" is a variable, only without the $ that would normally precede it if the variable were to appear in normal text.

The construction:

resets the value of an index variable to 1. The construction: increments the value of an index variable. The construction: advances "@" to refer to the "next" individual, index, or source in the database.

External HTML code can be inserted inline using the following construct:

Any occurrences of ``@'' in the ``filename_template'' are replaced by the cross-reference ID of the current individual (use ``@@'' to get ``@'' into the filename without replacement). The substituted template is then used as the name of a file to be included in the output stream. If the file does not exist, this construct is ignored. The included file is inserted verbatim into the output stream; no macroprocessing is performed on it.

The construct:

causes a ``pedigree chart'' of the default depth (specifiable by a command-line option, see here) for the specified individual to be inserted into the HTML output file at the current position. Except for the depth parameter, the format of the pedigree charts is not user-customizable.

The construct:

inserts the current date into the HTML output. The construct inserts the version number of GED2HTML into the HTML output.

I have organized the program so that it is language-independent, except for the tables in ``tags.c''. All strings in the output come either from the templates or from those tables. If you want to make the program produce output in another language, have a look at ``tags.h'' and ``tags.c'' to see what to do. You should also change the compilation flags in ``Makefile''. At the moment, only English is supported. If you create tables for another language, I'd appreciate receiving them so that I can integrate them back into the source. Thanks!

Please note that I have not made any specific attempt to support ``locales'' or international character sets. Except for converting surnames to upper-case (which can be disabled with a command-line option, see here), the program generally does not mutate input characters supplied to it, and I have at least seen German characters with umlauts, etc. passed properly by the program. I have also had feedback from someone who used an older version of the program to process Hebrew. It apparently worked for the most part, though there were a few problems that may have been caused by the program trying to capitalize surnames.

GED2HTML home page

Copyright © 1995 Eugene W. Stark. All rights reserved.
stark@cs.sunysb.edu
GED2HTML: What's New in the Current Release

GED2HTML: What's New in the Current Release

Version 2.4:

GED2HTML home page

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