Skip to content

Commit

Permalink
Handle an EVEN type of "event"
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jul 31, 2024
1 parent cc46150 commit 4fb8d90
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
38 changes: 37 additions & 1 deletion ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -6498,14 +6498,50 @@ sub print_person
# die $i->page();
} elsif($type eq 'Funeral') {
$funeral = $event;
} elsif($type eq 'event') {
# 1 EVEN Some text describing the event
# 2 TYPE event
# 2 DATE 29 Sep 1939
# 2 PLAC Margate, Kent, England
$Data::Dumper::Maxdepth = 2;
print Data::Dumper->new([$event])->Dump();
if($end_of_sentence) {
$bio .= ' ' unless($bio =~ /\s$/);
} else {
$bio .= '. ';
}
if(scalar(@phrases)) {
push @phrases, $phrase;
$bio_dt->append(conjunction(map { $_->as_string() } @phrases))->append('. ');
$phrase = Data::Text->new(' ');
} else {
$phrase->append(' ');
}
if(my $date = year(record => $event)) {
$date = ucfirst($date);
$bio .= " $date ";
$phrase->append("$date ");
}
$bio .= lc($pronoun);
$phrase->append(lc($pronoun));
if(my $value = $event->value()) {
$value = ' ' . lcfirst($value);
$bio .= $value;
$phrase->append($value);
}
if(my $place = place({ person => $person, record => $event })) {
$bio .= $place;
$phrase->append($place);
}
# } elsif(($type !~ /^Census U[KS] \d{4}$/) &&
} elsif(($type !~ /Census/) &&
($type ne 'Race') &&
($type ne 'Custom Marriage') &&
($type ne 'Email') &&
($type ne 'Register UK 1939')) {

red_warning({ person => $person, warning => "Unhandled event type: $type" });
complain({ person => $person, warning => "Unhandled event type: $type" });
die "TODO: event type $type";
if(my $notes = notes(record => $event, note_locations => \@note_locations)) {
$notes = ucfirst($notes);
$bio .= " ($notes)";
Expand Down
18 changes: 18 additions & 0 deletions tests/test-all-static → tests/test-all
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,22 @@ for i in $(find ~/gedcoms/* -name \*ged -o -name \*GED); do
grep 'etravel' static-site/*.html && exit 1
# grep ' ' static-site/*.html && exit 1
# grep ' ' dynamic-site/data/people.csv && exit 1

rm -rf dynamic-site/data dynamic-site/img static-site/
perl -MDevel::Hide=Geo::libpostal \
./ged2site -cFdwm "$i"
weblint static-site/*html
xmllint dynamic-site/data/people.xml > /dev/null
if [ -r dynamic-site/data/locations.xml ]; then
xmllint dynamic-site/data/locations.xml > /dev/null
fi

rm -rf dynamic-site/data dynamic-site/img static-site/
perl -MDevel::Hide=Geo::libpostal \
./ged2site "$i"
weblint static-site/*html
xmllint dynamic-site/data/people.xml > /dev/null
if [ -r dynamic-site/data/locations.xml ]; then
xmllint dynamic-site/data/locations.xml > /dev/null
fi
done

0 comments on commit 4fb8d90

Please sign in to comment.