home *** CD-ROM | disk | FTP | other *** search
/ The Best Internet Programs / BESTINTERNET.bin / latest / ged2ht20 / readme < prev    next >
Text File  |  1995-04-06  |  10KB  |  204 lines

  1.  
  2.               A GEDCOM to HTML Translator
  3.                Gene Stark
  4.              (stark@cs.sunysb.edu)
  5.           Version 2.0 (6 April, 1995)
  6.  
  7. This program reads a GEDCOM file as input and produces a set of HTML files,
  8. one for each individual record in the GEDCOM file.  Each individual file
  9. contains hypertext links (relative URL's) to the files for the parents,
  10. spouses, and children for that individual.  Birth, marriage, and death events
  11. are included in the file, as are notes records associated with the individual,
  12. and also certain source information.  A sorted index file can also be created,
  13. with a hypertext link to each individual.  The program can also automatically
  14. insert additional HTML text into each individual file.  This feature can be
  15. used add additional text, images, audio, or whatever you want to each
  16. individual.  Moreover, you only have to create the included files for the
  17. individuals on which you have extra information, and you can maintain all your
  18. other data on whatever system you are using to produce the GEDCOM output.
  19. If you get an updated GEDCOM file, simply go to the directory where the
  20. individual files are stored and run "ged2html" again.  It will update each
  21. individual file with the new GEDCOM data and will automatically insert the
  22. additional HTML text again.
  23.  
  24. I wrote this program because I tried the GEDCOM to HTML translator posted
  25. by Frode Kvam (frode@ifi.unit.no), and found it insufficiently flexible.
  26. Since it only parses a limited portion of the GEDCOM file, not including
  27. notes records, there wasn't an easy way to modify his program to get
  28. all my notes into the output files.  So, I decided to write a YACC-based
  29. parser for the GEDCOM standard, and to base the translator on that.
  30. The YACC parser was used in version 1 of this program, however as I got
  31. more experience with the GEDCOM standard and how it is actually used in
  32. practice, I decided that it was too difficult to make the YACC-based parser
  33. accept the variety of GEDCOM's that actually exist.  So, for the current
  34. version I have rewritten the parser so that it will accept essentially
  35. "any" GEDCOM file, and will only complain about grossly malformed input.
  36.  
  37. I have tested this program on a large number of GEDCOM's, including the
  38. following:
  39.  
  40.     * The "royal92.ged" file from ROOTS-L, which contains 30,682
  41.         lines of GEDCOM and 3,010 individuals.
  42.  
  43.     * The "Richard Austin database" (produced by PAF 2.3), which
  44.         contains 82,874 lines of GEDCOM and 6,482 individuals.
  45.         This database was provided to me by Bill Minnick
  46.         (svpafug@rahul.net).
  47.  
  48.     * A database (produced by Family Scrapbook), which contains
  49.         30521 lines and 2121 individuals.  This database was
  50.         provided to me by Bill Spurlock (shadow@mindspring.com).
  51.  
  52.     * All the databases on Yvon Cyr's Acadian/French Canadian CD-ROM.
  53.  
  54. The program parses GEDCOM's fairly rapidly, at about 3700 GEDCOM lines
  55. per second on my Intel 486/33MHz PC with 16MB of RAM running the FreeBSD
  56. operating system.  Parsing of the 82,874 line "Richard Austin database"
  57. takes 22 seconds of wall clock time, and it takes another 10 seconds or
  58. so to produce the 500KB sorted index file.  Under FreeBSD, complete
  59. processing of Austin database, including the production of the 6482 output
  60. files, takes just over 5 minutes of wall clock time.  Under DOS or Windows,
  61. creation of a large number of output files can take substantially longer,
  62. due to the less efficient filesystems used in those operating systems.
  63.  
  64. I have used this program to prepare my own data for presentation on the
  65. World-Wide Web.  You can view this data by starting from URL
  66.  
  67.      http://www.cs.sunysb.edu/~stark
  68.  
  69. and following the links.  I preprocessed my GEDCOM file to produce
  70. approximately 700 individual files, which are linked together between
  71. themselves and to my hypertext family history document.  Birger Wathne
  72. (Birger.Wathne@vest.sdata.no) and others are using version 1 of this program
  73. in various demonstrations of genealogy over the World-Wide Web.  Many of these
  74. demonstrations do not preprocess the data into HTML files, but rather use
  75. LifeLines to manage the database in GEDCOM format, and ged2html to process the
  76. output of queries for presentation over the Web.
  77.  
  78. I have developed and run this program on an Intel 486DX/33 under the
  79. FreeBSD operating system.  If you using another flavor of *ix, you
  80. shouldn't have too much trouble getting it to run.  You do need an ANSI C
  81. compiler (like GCC), as I am no longer interested in writing old-style C.
  82. I have also compiled the program for MS-DOS and MS-WINDOWS using Microsoft
  83. Visual C.  See the file MSDOS for details.
  84.  
  85. The GEDCOM parser in the program is built around the GEDCOM 5.3 standard.
  86. Whereas version 1 of this program checked the GEDCOM input fairly stringently
  87. for conformance to the standard, the current version attempts to make sense
  88. out of anything that looks like a GEDCOM file.  It will complain about
  89. grossly malformed GEDCOM files, but it still tries to get through to the
  90. end and produce whatever output it can.
  91.  
  92. The output processor is template-driven.  That is, it consists of an
  93. interpreter for a simple macro language, which produces output files by
  94. processing template strings and filling in information from the GEDCOM
  95. database.  The template-driven output scheme was used to obtain flexibility
  96. and language-independence.  The default templates use the cross-reference ID's
  97. in the GEDCOM file to name the HTML files, and will insert one "image" file
  98. (if it exists) near the beginning of each individual file and one "additional
  99. information" file (if it exists) at the end of each individual file.
  100. For example, an individual with cross-reference ID "I101" would receive an
  101. HTML file "I101.html".  As this file is created, the file "I101.img" would be
  102. inserted near the beginning, and the file "I101.inc" would be inserted at the
  103. end.  Default templates are compiled into the program, and they will be used
  104. unless you specify an alternative template using the appropriate command-line
  105. argument.
  106.  
  107. If you like the default output format, and you are happy with English as
  108. the output language, then there is no need for you to understand anything
  109. about the template macro language.  This is a good thing, because the
  110. macro language is not that pleasant to program in.  If you do want to
  111. write your own templates, have a look at the files "template_individual"
  112. and "template_index".  These use most, if not all, the available constructs
  113. in the output language.  A template file consists of text interspersed
  114. with variable references and control commands.  Variable references start
  115. with "$", and are used to insert in-line information from the GEDCOM database.
  116. Constructs that can appear in variables are as follows:
  117.  
  118.     @        denotes the "current individual"
  119.  
  120.     [i]        is a subscripting operation that selects the i-th
  121.             family, event, note, etc. in a list.  The identifier
  122.             i is an "index variable", which takes on values
  123.             1, 2, 3, etc.
  124.  
  125.     .fieldname    is a selection operation that follows associations
  126.             in the database.  For example ${@.FATHER} denotes
  127.             the individual record corresponding to the father
  128.             of the current individual.  You have to look at
  129.             the sample template files and the code in output.c
  130.             to see what selectors are understood.
  131.         
  132.     .&        is a selection operation that turns a string into
  133.             a URL to be output in an HTML anchor.
  134.  
  135.     i        refers to the index variable i.
  136.  
  137.     {}        appearing in a variable name act as delimiters.
  138.             They must be properly matched.
  139.  
  140. Control constructs are signalled by a "!" appearing at the beginning of
  141. a template line.  The control constructs are:
  142.  
  143.     !IF condition
  144.     !THEN
  145.     !ELSE
  146.     !ENDIF
  147.  
  148. The above constructs provide for conditional output based on whether
  149. particular fields in the database have non-null values.
  150.  
  151.     !WHILE condition
  152.     !END
  153.  
  154. These constructs provide for repetitive output of a particular section of
  155. the template, based on what is in the database.  For example, it can be
  156. used to iterate over all the marriages of a particular individual.
  157.  
  158. In both the !IF and !WHILE constructs, the "condition" is a variable,
  159. only without the $ that would normally precede it if the variable were
  160. to appear in normal text.
  161.  
  162.     !RESET index_variable
  163.  
  164. Resets the value of an index variable