Including HTML Code Inline

The standard output program compiled into GED2HTML provides 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 for a file "xxxxx.img", where "xxxxx" is the GEDCOM identifier (RIN) (see below) of the individual being processed. By default, the program looks for this file in the "destination directory", which is the directory in which the HTML output files and subdirectories are being created. 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, the file "xxxxx.img" might contain the code: <IMG SRC="daddy.gif"> This code will end up getting inserted inline into the HTML output for individual with ID "xxxxx". The effect will be that when the page for this individual is viewed, the image from the GIF file daddy.gif will appear as part of the page.

The second place where the standard template allows for arbitrary inclusions is at the end of the information for each individual. At this point, GED2HTML 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 customize the output program, you can arrange for inlining anything you want, using the same mechanism as is used by the default program. For more information on customizing the output program, see here.

There are several option variables whose values affect the behavior of the inlining feature. The INCLUDE_PATH variable is a string that is automatically prepended by the standard output program to the GEDCOM identifier (RIN) for an individual, to construct the name of an associated external file to be included in the HTML output. The default value is the empty string. You might find it useful to set this variable to the full path name of a directory in which you keep all the files to be included when you process your GEDCOM. The INCLUDE_IMAGE_EXT and INCLUDE_INFO_EXT variables are strings that are automatically appended by the standard output program to the GEDCOM identifier when constructing the name of the file to be included. The default values are .img and .inc, respectively. The INCLUDE_IMAGE_EXT variable is for the first include, which is intended to be used to include an image of an individual. The INCLUDE_INFO_EXT variable is for the second include, which is intended to be used to include additional information about an individual.

Example

Suppose you had a photo you wanted to include in the output for the individual with GEDCOM identifier I123. Create a directory somewhere on your system, into which you will place the file to be included. For example, you might create: C:\Windows\Desktop\G2h-includes Next, create a file in the new directory with the name I123.img. Use a text editor (like Notepad) to put the following text in this file: <IMG SRC="../images/daddy.gif"> Then, run GED2HTML and put the following in the "Additional Options" field of the dialog screen: -D INCLUDE_PATH="C:\Windows\Desktop\G2h-includes" This will cause the HTML directory to be created as usual, with all the individual data files in subdirectories. Finally, create a subdirectory images of the HTML directory and put the image file daddy.gif there.

If all is well, when you view the files with your browser, the image will appear near the beginning of the page for individual I123. If this doesn't happen, then you have to debug what went wrong. This requires some familiarity with HTML and how browsers find documents and images, and it is outside the scope of what I can explain here. Please consult an HTML primer to get a better understanding of what might have happened.

GEDCOM Identifiers (RINs)

Every individual in a GEDCOM file gets assigned an identifier that permits cross references between one part of the GEDCOM and another. These identifiers are sometimes called "RINs". The exact format of the string used for a RIN depends on the particular program that created the GEDCOM, though many genealogy programs use an "I" followed by a number, such as I123.

GED2HTML uses the RIN of an individual to construct names for external files to be included in the HTML output for that individual. To find out the RIN of an individual, you generally have to look in the GEDCOM (use a text editor such as Notepad or Wordpad), and find the defining record for that individual. This will look something like the following:

0 @I123@ INDI 1 NAME Joe /BLOW/ 1 BIRT 2 DATE 1 JAN 2000 and so on. The RIN is the string in between the @@. Sometimes, genealogy programs (such as PAF) use the RINs as a means for users to identifying individuals when entering data. In this case, you won't have to look into the GEDCOM to find out what the RIN for an individual is. In other cases, a genealogy program will renumber the individuals every time a GEDCOM is exported, so you'll have no choice but to look in the GEDCOM and adjust the names of your include files accordingly.

GED2HTML home page

Copyright © 1995-2000 Eugene W. Stark. All rights reserved.
SEND ME EMAIL