# # GED2HTML output program -- customize to taste # # Copyright (c) 1998 Eugene W. Stark # All rights reserved. # ## Okay then. ## ## Well, this is a fantastic program. I didn't think I could do ## all these things, but I registered anyway. And the output changes ## I've made to suit me are very easy to do. Great program, Mr. Stark. ## ## Changes I've made: ## 1) Many appearance tweaks. ## 2) A table-based index to line up names. ## 3) A table-based 4-gen pedigree chart that fits all screens. ## 3.5) A table-based families chart ## 4) Shuffling of code in this program to more easily follow output. ## 5) A catch-all "footer" line, consistent across all pages. ## ## Changes by Robert Stewart, 27 Apr 99, stewartr@csi.com ## ## Permission is hereby granted to registered users of GED2HTML to # make copies and modifications to this code for their own personal # use and to distribute such modified copies, provided that this # copyright notice is retained on all modified or distributed copies. # Any other use of this code is prohibited without written permission. # #--------------------------------------------------------------------- # The first several definitions in this file are entry points that # the output processor expects to be here. Whatever changes you make, # you must leave some sort of definitions here for these routines. #--------------------------------------------------------------------- define do_initialize { do_initialize_ ; } define do_index i { do_index_ i ; } define do_surnames s { do_surnames_ s ; } define do_individuals i { do_individuals_ i ; } define do_families f { do_families_ f ; } define do_sources s { do_sources_ s ; } define do_notes n { do_notes_ n ; } define do_gendex i { do_gendex_ i ; } #--------------------------------------------------------------------- # The rest are auxiliary routines used by the above. # You can change whatever you want from this point on. #--------------------------------------------------------------------- #--------------------------------------------------------------------- # INITIALIZATION #--------------------------------------------------------------------- # This routine runs *after* the initialization routine from an options # file specified in the dialog box or command line, and *before* any # GEDCOM is read. define do_initialize_ local l { internationalize ; # # The purpose of the following silliness is to get an English-formatted # date to put in the META elements of the HTML output, without # affecting the previously selected language and locale. # set l to LANGUAGE set LANGUAGE to "English" set METADATE to TODAY set LANGUAGE to l } #--------------------------------------------------------------------- # PAGE HEADERS AND FOOTERS #--------------------------------------------------------------------- # Output the HTML BODY tag, handling colors, images, etc. define html_body { print "
" ; } # Produce the footer on each HTML page. define page_footer { print "| "; print ""; print "" , print_alternatives INDEX_TEXT "Index" ; print ", " ; print "" , print_alternatives SURNAMES_TEXT "Surnames" ; print ", " ; if HOMEPAGE then print "" , print_alternatives HOME_TEXT "Home" ; print ", " ; else print " " ; end if MAILTO then print "" , print_alternatives EMAIL_TEXT "E-mail" ; print ", " ; end print ""; print " | "; print ""; print "" , print_alternatives CREATED_BY_TEXT "HTML by" ; print " " VERSION " " , print " " TODAY ". " ; print ""; print " |
" ,
print_alternatives AUTHOR_TEXT "Author" ;
print_alternatives COLON_TEXT ": " ;
print "
" ,
if s.name & s.name.text then
print s.name.text ,
print "
" ;
end
if s.address & s.address.text then
set t to s.address.text
while t do
print t.text ,
if t.cont then
print ", " ,
set t to t.cont
else
set t to t.conc
end
end
print "
" ;
end
if s.phone & s.phone.text then
print s.phone.text ;
print "
" ;
end
end
}
# Output author contact information, if MAILTO is set
define author_contact
{
if MAILTO then
print "" ,
print_alternatives EMAIL_TEXT "E-mail" ;
print "" ;
print "
" ; print_text HEADER.note 0 ; print "
" ; end if HEADER.submitter then submitter_info HEADER.submitter ; end author_contact ; end # # The Index of Persons, between the lines, itself # print "" ; # print "
| "; # print "" , print_name i.first.name ; if i.first.title then print " (" i.first.title ")" , end # print "" ; print " | "; # print " -to- " , # print " | "; print "" , # print_name i.last.name ; if i.last.title then print " (" i.last.title ")" , end print "" ; # print " |
| "; # print "" ; print "" , print_name i.first.name ; if i.first.living then print "" , else if i.first.title then print " (" i.first.title ")" , end print "" , # print " | "; # print " (" , birth_and_death i.first ; print ")" , end # print " |
" ; if i then if i.parent then if UP_TEXT then index_link UP_TEXT i.parent which ; else index_link "UP" i.parent which ; end end if i.prev then if BACK_TEXT then index_link BACK_TEXT i.prev which ; else index_link "BACK" i.prev which ; end else set pred to i.pred if pred then if BACK_TEXT then index_link BACK_TEXT i.parent.pred which ; else index_link "BACK" i.parent.pred which ; end end end if i.next then if NEXT_TEXT then index_link NEXT_TEXT i.next which ; else index_link "NEXT" i.next which ; end else set succ to i.succ if succ then if NEXT_TEXT then index_link NEXT_TEXT i.succ which ; else index_link "NEXT" i.succ which ; end end end end print "
" ; } # Output a link to a node i in the persons index, # with d as the highlighted text of the link. # The third argument is zero for persons index, nonzero for # surnames index define index_link d s which { print "" d "" , print " (" , if which then emit_surname s.first.surname ; print " - " , emit_surname s.last.surname ; else print_name s.first.name ; print " - " , print_name s.last.name ; end print ")" ; print_text HEADER.note 0 ; print "
" ; end if HEADER.submitter then submitter_info HEADER.submitter ; end author_contact ; end # # If the index consists of a single node, and we haven't been # asked to produce a hierarchical index, then use "alphabet tab" format # if ~s.children & SURNAME_WIDTH = 0 & ~NO_ALPHABET_TABS then do_alphabetical s ; # # Otherwise use the more general hierarchical format # else print "" ;
while s do
if s.children then # Internal node of hierarchical index
# emit index tabs to lower levels
print "" ;
emit_surname s.first.surname ;
print " -- to -- " ,
emit_surname s.last.surname ;
print "
" ;
else # Leaf node of hierarchical index
# emit links to persons index
print "" ,
emit_surname s.first.surname ;
print "" ,
if s.next then
print "," ;
else
print ;
end
end
if ~s.next then
print "