home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / vrac / ged2ht23.zip / README < prev    next >
Text File  |  1995-07-09  |  11KB  |  228 lines

  1.  
  2.               A GEDCOM to HTML Translator
  3.           Version 2.3 (July 4, 1995)
  4.  
  5.                Gene Stark
  6.               (stark@cs.sunysb.edu)
  7.  
  8.              Dept. of Computer Science
  9.             SUNY at Stony Brook
  10.              Stony Brook, NY 11794-4400
  11.  
  12. This program reads GEDCOM files as input and produces a set of HTML files,
  13. each file containing information from one or more individual records in
  14. the GEDCOM input.  The information for each individual contains hypertext
  15. links (relative URL's) to the files for the parents, spouses, and children
  16. for that individual.  Birth, marriage, and death events are included in the
  17. file, as are notes records associated with the individual, and also certain
  18. source information.  A sorted, hierarchical index can also be created, with
  19. a hypertext link to each individual.  The program can be instructed to include
  20. "pedigree charts" with each individual, to facilitate navigation between
  21. individuals.  The program can also automatically insert additional HTML text
  22. into each individual file.  This feature can be used add additional text,
  23. images, audio, or whatever else you want to each individual.  Moreover, you
  24. only have to create the "include files" for the individuals on which you have
  25. extra information, and you can maintain all your other data on whatever system
  26. you are using to produce the GEDCOM output.  If you get an updated GEDCOM file,
  27. simply go to the directory where the individual "include files" are stored and
  28. run "ged2html" again.  It will update each individual file with the new GEDCOM
  29. data and will automatically insert the additional HTML text from the "include
  30. files" again.
  31.  
  32. I wrote this program because I tried the GEDCOM to HTML translator posted
  33. by Frode Kvam (frode@ifi.unit.no), and found it insufficiently flexible.
  34. Since his program only parses a limited portion of the GEDCOM file, not
  35. including notes records, there wasn't an easy way to modify it to get
  36. all my notes into the output files.  So, I decided to write a YACC-based
  37. parser for the GEDCOM standard, and to base the translator on that.
  38. The YACC parser was used in version 1 of my program, however as I got
  39. more experience with the GEDCOM standard and how it is actually used in
  40. practice, I decided that it was too difficult to make the YACC-based parser
  41. accept the full variety of GEDCOM's that actually exist.  So, for the current
  42. version I have rewritten the parser so that it will accept essentially
  43. "any" GEDCOM file, and will only complain about grossly malformed input.
  44.  
  45. I have tested this program on a large number of GEDCOM's, including the
  46. following:
  47.  
  48.     * The "royal92.ged" file from ROOTS-L, which contains 30,682
  49.         lines of GEDCOM and 3,010 individuals.
  50.  
  51.     * The "Richard Austin database" (produced by PAF 2.3), which
  52.         contains 82,874 lines of GEDCOM and 6,482 individuals.
  53.         This database was provided to me by Bill Minnick
  54.         (svpafug@rahul.net).
  55.  
  56.     * A database (produced by Family Scrapbook), which contains
  57.         30521 lines and 2121 individuals.  This database was
  58.         provided to me by Bill Spurlock (shadow@mindspring.com).
  59.  
  60.     * All the databases on Yvon Cyr's Acadian/French Canadian CD-ROM.
  61.  
  62.     * A number of other databases provided to me by users of earlier
  63.         versions of this program.
  64.  
  65. Small GEDCOM's of under 1000 individuals are processed into HTML by GED2HTML
  66. in a few seconds on a modern PC running Un*x (processing is somewhat slower
  67. under MS-DOS due to the inefficient filesystem).  However, on a system with
  68. sufficient swap space and main memory, much larger GEDCOM's can be processed.
  69. The program is capable of processing all the GEDCOM's on Yvon Cyr's
  70. Acadian/French Canadian CD-ROM.  The largest database I have attempted is the
  71. file "t-roux.ged" on that CD-ROM, which is a 5478458 byte, 214266 line GEDCOM
  72. file containing 15472 individuals and 7012 families.  On my system (486/33
  73. with 16MB RAM and IDE disks, running the FreeBSD 2.0.5 operating system),
  74. it took roughly 35 minutes to process this file, of which under five minutes
  75. was spent reading the file and constructing the database, and the remainder
  76. was spent in outputting 1548 HTML files of individual data, 10 individuals per
  77. file, organized into 31 directories, a three-level hierarchical index
  78. consisting of 574 HTML files, and a surname index in a single HTML file.
  79. The HTML output files consumed 18738K of disk space.  The processing itself
  80. required 32MB of virtual memory.
  81.  
  82. I have used this program to prepare my own data for presentation on the
  83. World-Wide Web.  You can view this data by starting from URL
  84.  
  85.      http://www.cs.sunysb.edu/~stark
  86.  
  87. and following the links.  I preprocessed my GEDCOM file to produce
  88. approximately 700 individual files, which are linked together between
  89. themselves and to my hypertext family history document.  Birger Wathne
  90. (Birger.Wathne@vest.sdata.no) and others are using various versions of this
  91. program in various demonstrations of genealogy over the World-Wide Web.
  92. Many of these demonstrations do not preprocess the data into HTML files,
  93. but rather use LifeLines to manage the database in GEDCOM format, and
  94. ged2html to process the output of queries for presentation over the Web.
  95.  
  96. I have developed and run this program on an Intel 486DX/33 under the
  97. FreeBSD operating system.  If you using another flavor of Un*x, you
  98. shouldn't have too much trouble getting it to run.  You do need an ANSI C
  99. compiler (like GCC), as I am no longer interested in writing old-style C.
  100. I have also compiled the program for MS-DOS and MS-WINDOWS using Microsoft
  101. Visual C/C++ 1.0.  See the file MSDOS for differences in the default behavior
  102. of the MS-DOS/MS-WINDOWS and Un*x versions of this program.
  103.  
  104. The GEDCOM parser in the program is built around the GEDCOM 5.3 standard.
  105. Whereas version 1 of this program checked the GEDCOM input fairly stringently
  106. for conformance to the standard, the current version attempts to make sense
  107. out of anything that looks remotely like a GEDCOM file.  It will complain about
  108. grossly malformed GEDCOM files, but it still tries to get through to the
  109. end and produce whatever output it can.
  110.  
  111. The output processor is template-driven.  That is, it consists of an
  112. interpreter for a simple macro language, which produces output files by
  113. processing template strings and filling in information from the GEDCOM
  114. database.  The template-driven output scheme was used to obtain flexibility
  115. and language independence.  The default templates use the cross-reference ID's
  116. in the GEDCOM file to name the HTML files, and will insert one "image" file
  117. (if it exists) near the beginning of each individual file and one "additional
  118. information" file (if it exists) at the end of each individual file.
  119. For example, an individual with cross-reference ID "I101" would receive an
  120. HTML file "I101.html".  As this file is created, the file "I101.img" would be
  121. inserted near the beginning, and the file "I101.inc" would be inserted at the
  122. end.  Default templates are compiled into the program, and they will be used
  123. unless you specify an alternative template using the appropriate command-line
  124. argument.
  125.  
  126. If you like the default output format, and you are happy with English as
  127. the output language, then there is no need for you to understand anything
  128. about the template macro language.  This is a good thing, because the
  129. macro language is not that pleasant to program in.  If you do want to
  130. write your own templates, have a look at the files "indiv.tpl", "index.tpl",
  131. and "surname.tpl".  These use most, if not all, the available constructs
  132. in the output language.  A template file consists of text interspersed
  133. with variable references and control commands.  Variable references start
  134. with "$", and are used to insert in-line information from the GEDCOM database.
  135. Constructs that can appear in variables are as follows:
  136.  
  137.     @        denotes the "current individual" or "current index"
  138.  
  139.     [i]        is a subscripting operation that selects the i-th
  140.             family, event, note, etc. in a list.  The identifier
  141.             i is an "index variable", which takes on values
  142.             1, 2, 3, etc.
  143.  
  144.     .fieldname    is a selection operation that follows associations
  145.             in the database.  For example ${@.FATHER} denotes
  146.             the individual record corresponding to the father
  147.             of the current individual.  You have to look at
  148.             the sample template files and the code in output.c
  149.             to see what selectors are understood.
  150.         
  151.     .&        is a selection operation that turns an individual
  152.             record or index node into a URL to be output in an
  153.             HTML anchor.
  154.  
  155.     i        refers to the index variable i.
  156.  
  157.     {}        appearing in a variable name act as delimiters.
  158.             They must be properly matched.
  159.  
  160. Control constructs are signalled by a "!" appearing at the beginning of
  161. a template line.  The control constructs are:
  162.  
  163.     !IF condition
  164.     !THEN
  165.     !ELSE
  166.     !ENDIF
  167.  
  168. The above constructs provide for conditional output based on whether
  169. particular fields in the database have non-null values.
  170.  
  171.     !WHILE condition
  172.     !END
  173.  
  174. These constructs provide for repetitive output of a particular section of
  175. the template, based on what is in the database.  For example, it can be
  176. used to iterate over all the marriages of a particular individual.
  177.  
  178. In both the !IF and !WHILE constructs, the "condition" is a variable,
  179. only without the $ that would normally precede it if the variable were
  180. to appear in normal text.
  181.  
  182.     !RESET index_variable
  183.  
  184. Resets the value of an index variable to 1.
  185.  
  186.     !INCREMENT index_variable
  187.  
  188. Increments the value of an index variable.
  189.  
  190.     !NEXT
  191.  
  192. Advances "@" to refer to the "next" individual or index in the database.
  193.  
  194.     !INCLUDE filename_template
  195.  
  196. Any occurrences of "@" in the "filename_template" are replaced by the
  197. cross-reference ID of the current individual (use "@@" to get "@" into
  198. the filename without replacement).  The substituted template is then used
  199. as the name of a file to be included in the output stream.  If the file
  200. does not exist, this construct is ignored.  The included file is inserted
  201. verbatim into the output stream; no macroprocessing is performed on it.
  202.  
  203.     !PEDIGREE indiv_variable
  204.  
  205. Causes a "pedigree chart" of the default depth (specifiable by a command-line
  206. option) for the specified individual to be inserted into the HTML output file
  207. at the current position.  Except for the depth parameter, the format of the
  208. pedigree charts is not user-customizable.
  209.  
  210. I have organized the program so that it is language-independent, except for
  211. the tables in "tags.c".  All strings in the output come either from the
  212. templates or from those tables.  If you want to make the program produce
  213. output in another language, have a look at "tags.h" and "tags.c" to see what
  214. to do.  You should also change the compilation flags in "Makefile".  At the
  215. moment, only English is supported.  If you create tables for another language,
  216. I'd appreciate receiving them so that I can integrate them back into the
  217. source.  Thanks!
  218.  
  219. THANKS: go to Birger Wathne for contributing useful ideas and code, and to
  220. a number of other users (including Allyn Brosz, Susie and Kerry Jane Dunavant,
  221. Bob Fieg, Steve Messinger, and Doug Smith) of earlier versions of the program
  222. who took the trouble to send me their bug reports and problematic GEDCOMS as
  223. well as their kind words that make all the work I did on this program
  224. worthwhile.
  225.  
  226.                             Gene Stark
  227.                             stark@cs.sunysb.edu
  228.