The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTML::Timeline - Convert a Gedcom file into a Timeline file

Synopsis

        shell> perl bin/timeline.pl -h

Description

HTML::Timeline is a pure Perl module.

Distributions

This module is available as a Unix-style distro (*.tgz).

See http://savage.net.au/Perl-modules.html for details.

See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing.

Constructor and initialization

new(...) returns an object of type HTML::Timeline.

This is the class contructor.

Usage: HTML::Timeline -> new().

This method takes a hashref of options.

Call new() as new(option_1 => value_1, option_2 => value_2, ...).

See the next section for a discussion of the resource file $HOME/.timelinerc, which can be used to override the default values for options.

Available options:

ancestors $Boolean

If this option is 1, the ancestors of the root_person (see below) are processed.

If this option is 0, their descendents are processed.

Default: 0.

everyone $Boolean

If this option is 1, everyone is processed, and the root_person (see below) is ignored.

If this option is 0, the root_person is processed.

Default: 0.

gedcom_file $a_file_name

This takes the name of your input Gedcom file.

Default: 'bach.ged'.

include_spouses $Boolean

If this option is 1, and descendents are processed, spouses are included.

If this option is 0, spouses are ignored.

Default: 0.

missing_as_table $Boolean

If this option is 1, people with missing birthdates are listed under the timeline, in a table.

If this option is 0, such people appear on the timeline, with a date (today) as their birthdate.

Default: 0.

output_dir $a_dir_name

If this option is used, the output HTML and XML files will be created in this directory.

Default: '';

root_person $a_personal_name

The name of the person on which to base the timeline.

Default: 'Johann Sebastian Bach'.

template_dir $a_dir_name

If this option is used, HTML::Template will look in this directory for 'timeline.tmpl'.

If this option is not used, the current directory will be used.

Default: ''.

template_name $a_file_name

If this option is used, HTML::Template will look for a file of this name.

If this option is not used, 'timeline.tmpl' will be used.

Default: ''.

url_for_xml $a_url

If this option is used, it becomes the prefix of the name of the output XML file written into timeline.html.

If this option is not used, no prefix is used.

Default: ''.

validate_gedcom_file $Boolean

If set to 1, call validate() on the Gedcom object. This validates the Gedcom file.

Default: 0.

verbose $Boolean

Write more or less progress messages to STDERR.

Default: 0.

web_page a_file_name

If this option is used, it specfies the name of the HTML file to write.

If this option is not used, 'timeline.html' is written.

See the output_dir option for where the file is written.

Default: 'timeline.html'.

xml_file $an_xml_file_name

The name of your XML output file.

Default: 'timeline.xml'.

Note: The name of the XML file is embedded in timeline.html, at line 28. You will need to edit the latter file if you use a different name for your XML output file.

The resource file $HOME/.timelinerc

The program looks for a file called $HOME/.timelinerc during execution of the constructor.

If this file is present, the module Config::IniFiles is loaded to process it.

If the file is absent, Config::IniFiles does not have to be installed.

This file must contain the section [HTML::Timeline], after which can follow any number of options, as listed above.

The option names in the file do not start with hyphens.

If the same option appears two or more times, the last appearence is used to set the value of that option.

The values override the defaults listed above.

These values are, in turn, overridden by the values passed in to the constructor.

This means that command line options passed in to timeline.pl will override the values found in $HOME/.timelinerc.

Sample file:

        [HTML::Timeline]
        output_dir=/var/www/html

Method: log($message)

If new() was called as new({verbose => 1}), write the message to STDERR.

If new() was called as new({verbose => 0}) (the default), do nothing.

Method: run()

Do everything.

See examples/timeline.pl for an example of how to call run().

See also

The Gedcom module.

Running Tests

        perl -I../lib ../bin/timeline.pl -gedcom_file ../examples/bach.ged -output_dir /tmp -template_name ../examples/timeline.tmpl

Support

Support is via the Gedcom mailing list.

Subscribe via perl-gedcom-subscribe@perl.org.

Credits

The MIT Simile Timeline project, and others, are at http://code.google.com/p/simile-widgets/.

Its original home is at http://simile.mit.edu/timeline.

Philip Durbin write the program examples/ged2xml.pl, which Ron Savage converted into a module.

Philip also supplied the files examples/bach.* and examples/timeline.html.

Ron Savage wrote bin/timeline.pl.

examples/timeline.xml is the output of that program, using the default options.

Repository

https://github.com/ronsavage/HTML-Timeline

Author

HTML::Timeline was written by Ron Savage <ron@savage.net.au> in 2008.

Home page: http://savage.net.au/index.html

Copyright

Australian copyright (c) 2008, Ron Savage.

        All Programs of mine are 'OSI Certified Open Source Software';
        you can redistribute them and/or modify them under the terms of
        The Perl License, a copy of which is available at:
        http://dev.perl.org/licenses/