-print '<ul class="timeline">'."\n";
-foreach (array_reverse($cal) as $title => $versions) {
- $time = ($mindate - strtotime($title)) / (3600 * 24 * 365 / 8); # ~8em/yr
- printf('<li style="left:%.1fem">', $time);
- if ($url = @$versions['']) {
- printf('<a href="/%s">%s</a>', $url, $title);
+printf('<ul class="timeline" style="background-size:%.1fem">'."\n", $length);
+foreach (array_reverse($cal, TRUE) as $group => $rows) {
+ if (count($rows) > 1) {
+ $time = ($mindate - strtotime("$group-12-31T23:59")) / $year * $scale;
+ printf('<li class="range" style="left:%.1fem; width:%.1fem">',
+ $time, $time + $scale > $length ? $length - $time + 2 : $scale
+ );
+ print "<strong>$group</strong><ul>\n";