From 522c4c94e1f9c12f1c002ba31e45aea6fa0722fc Mon Sep 17 00:00:00 2001 From: "David F. Skoll" Date: Mon, 1 Oct 2007 17:59:33 -0400 Subject: [PATCH] Add --imgbase option. --- www/rem-default.css | 28 +++++++++++++++++++++------- www/rem2html | 17 +++++++++++++---- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/www/rem-default.css b/www/rem-default.css index df9e9253..e4be3291 100644 --- a/www/rem-default.css +++ b/www/rem-default.css @@ -1,3 +1,20 @@ +table.rem-cal { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; +} + +table.rem-sc-table { + font-family: helvetica, arial, sans-serif; + font-size: 10pt; + width: 95%; + float: left; +} + +caption.rem-cal-caption { + font-size: 14pt; + font-weight: bold; +} + th.rem-cal-hdr { width: 14%; border-style: solid; @@ -6,21 +23,21 @@ th.rem-cal-hdr { } td.rem-empty { width: 14%; - height: 5em; + height: 7em; border-style: solid; border-width: 1px; vertical-align: top; } td.rem-cell { width: 14%; - height: 5em; + height: 7em; border-style: solid; border-width: 1px; vertical-align: top; } td.rem-small-calendar { width: 14%; - height: 5em; + height: 7em; border-style: solid; border-width: 1px; vertical-align: top; @@ -44,21 +61,18 @@ div.rem-moon { th.rem-sc-hdr { text-align: right; - font-size: x-small; } td.rem-sc-empty-cell { text-align: right; - font-size: x-small; width: 14%; } td.rem-sc-cell { text-align: right; - font-size: x-small; width: 14%; } caption.rem-sc-caption { - font-size: x-small; + font-size: 12pt; } \ No newline at end of file diff --git a/www/rem2html b/www/rem2html index f31f90b8..b38d8517 100755 --- a/www/rem2html +++ b/www/rem2html @@ -43,6 +43,7 @@ Options: --backurl url Make the title on the previous month's small calendar entry a link to --forwurl url Same as --backurl, but for the next month's small calendar +--imgbase url Base URL of images --tableonly Output results as a only, no , , etc. --title What to put in ... tags --prologue html_text Text to insert at the top of the body @@ -67,6 +68,7 @@ sub parse_options "title|ti:s", "prologue|pr:s", "epilogue|ep:s", + "imgbase|ib:s", "tableonly|to"); $Options{'title'} ||= 'HTML Calendar'; $Options{'stylesheet'} ||= "rem-default.css"; @@ -163,17 +165,20 @@ sub parse_input my ($phase, $moonsize, $fontsize, $msg) = ($1, $2, $3, $4); $moons->[$d]->{'phase'} = $phase; $moons->[$d]->{'msg'} = $msg; + } elsif ($body =~ /(\S+)/) { + $moons->[$d]->{'phase'} = $1; + $moons->[$d]->{'msg'} = ''; } } elsif ($special eq 'SHADE') { if ($body =~ /(\d+)\s+(\d+)\s+(\d+)/) { $shades->[$d] = sprintf("#%02X%02X%02X", - $1 % 255, $2 % 255, $3 % 255); + ($1 % 256), ($2 % 256), ($3 % 256)); } } elsif ($special eq 'COLOR') { if ($body =~ /(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/) { my($r, $g, $b, $text) = ($1, $2, $3, $4); my $color = sprintf("style=\"color: #%02X%02X%02X;\"", - $r % 255, $g % 255, $b % 255); + $r % 256, $g % 256, $b % 256); push(@{$days->[$d]}, '

' . escape_html($text) . '

'); } } elsif ($special eq '*') { @@ -348,7 +353,7 @@ sub draw_day_cell } else { $shade = ""; } - print "
\n"; + print "\n

"; if ($moons->[$day]) { my $phase = $moons->[$day]->{'phase'}; my $msg = $moons->[$day]->{'msg'}; @@ -366,10 +371,14 @@ sub draw_day_cell } else { $img = 'lastquarter.png'; } + if ($Options{'imgbase'}) { + $img = $Options{'imgbase'} . '/' . $img; + } print("

\"$img\"$msg
"); } - print "
$day
\n"; + print "
$day

\n"; + print "

 

\n"; if ($days->[$day]) { print(join("\n", @{$days->[$day]})); }