Extension:TimelineTable

What can this extension do?
This extension is a simple tag extension that generates timelines contained in html tables. From a list of events in the correct format, the extension will generate a html table (with a line for each event) spanning the columns over the event time range. Table formatting uses CSS defined in mediawiki:common.css file.

Usage
There are two modes for the extension (timeline with years and months only or with years, months and days).


 * To display a timeline with only years and months, enter the following inn your Mediawiki code:

This will generate a html table with three rows (one per event), and a column for each month from the first month of the earliest event to the last month of the last event.




 * To display a timeline with years, months and days, enter the following inn your Mediawiki code:

This will generate a html table with three rows (one per event), and a column for each day between the beginning of the earliest event and the end of the last event.



To modify the table format, define CSS classes in mediawiki:common.css. Here is a sample CSS code.

Download instructions
Please cut and paste the code found below and place it in. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
To install this extension, add the following to LocalSettings.php:

Configuration parameters
The extension contains two parameters that can be passed when creating a table:
 * title - Defines the title that will be put at the top of the table.
 * footer - Defines the table footer text.

In addition the following variables defined in  can be modified: // Separator for parsing lines of the input. $wgTimelineLineSeparator = "\n"; // Separator for parsing fields of a single event. $wgTimelineFieldSeparator = "\|"; // Separator for parsing the date of an event. $wgTimelineDateSeparator = "-"; // If the total length of the timetable (in days) is larger than this value, do not display days in table. $wgTimelineMaxCells      = 100; // Line return (in the rendered html file). $wgHTMLlr                = "\n"; // Tabulation (in the rendered html file). $wgHTMLtab               = "\t";

Code
$wgHTMLlr";

// Define the html code as a marker, then change it back to text in // 'efTimelineAfterTidy'. This is done to prevent the html code from being // modified afterwards. global $markerList; $makercount = count($markerList); $marker = "xx-marker".$makercount."-xx"; $markerList[$makercount] = $timeline_str; return $marker; }

function efTimelineAfterTidy(&$parser, &$text) {	// find markers in $text // replace markers with actual output global $markerList; for ($i = 0; $i