-- Made output of "remind -p" include day names so back-ends can

adapt to non-English languages.
This commit is contained in:
dfs
1998-01-24 03:20:01 +00:00
parent c0d14e6d62
commit 0a990f91ee
5 changed files with 55 additions and 30 deletions
+27 -18
View File
@@ -2,7 +2,7 @@
# rem2html
#
# $Id: rem2html,v 1.4 1997-09-21 23:23:41 dfs Exp $
# $Id: rem2html,v 1.5 1998-01-24 03:20:11 dfs Exp $
#
# A script to convert from the output of "remind -p" to Hyper-Text Markup
# Language (HTML), the text format used in WWW documents. By default, it
@@ -32,11 +32,15 @@ if ($Options{'help'}) {
} elsif ($Options{'version'}) {
print "Rem2HTML Version $rem2html_version.\n";
} else {
&parse_input();
&output_header();
&output_data();
&output_footer();
$successes = 0;
while(1) {
last if (!parse_input());
$successes++;
&output_header();
&output_data();
&output_footer();
}
print STDERR "Rem2HTML: Couldn't find any calendar data.\n" if (!$successes);
}
exit(0);
@@ -106,11 +110,13 @@ sub parse_input {
$caption = "$month, $year";
for $i ( 1 .. $month_length) { push(@days, ""); }
} elsif ($where == 2) {
@prevsc = split(" ");
@DayNames = split(" ");
} elsif ($where == 3) {
@prevsc = split(" ");
} elsif ($where == 4) {
@nextsc = split(" ");
} else {
last if /rem2(html|ps) end/;
return 1 if /rem2(html|ps) end/;
next unless m/^(\d*).(\d*).(\d*)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*(.*)$/;
$type = $4;
$msg = $8;
@@ -124,8 +130,10 @@ sub parse_input {
}
$where++;
}
die "Rem2HTML: Could not find any calendar data.\n", unless $where;
if ($where) {
return 1;
}
return 0;
}
sub output_header {
@@ -158,13 +166,13 @@ EndOfHTML
<TR>
EndOfHTML
$mfirst || &print_day_header("Sunday");
$mfirst || &print_day_header($DayNames[0]);
foreach $dayheader (Monday,Tuesday,Wednesday,Thursday,Friday,Saturday) {
&print_day_header($dayheader);
for($i=1; $i<7; $i++) {
&print_day_header($DayNames[$i]);
}
$mfirst && &print_day_header("Sunday");
$mfirst && &print_day_header($DayNames[0]);
print " </TR>\n";
}
@@ -253,13 +261,14 @@ sub small_calendar {
<TR>
EndOfHTML
$mfirst || &print_day_header("S", 1);
$mfirst || &print_day_header(substr($DayNames[0], 0, 1), 1);
foreach $l (M,T,W,T,F,S) {
&print_day_header($l, 1);
for ($i=1; $i<7; $i++) {
&print_day_header(substr($DayNames[$i], 0, 1), 1);
}
$mfirst && &print_day_header("S", 1);
$mfirst && &print_day_header(substr($DayNames[0], 0, 1), 1);
print "</TR>\n";
for $week ( 0..5 ) {