-- 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

View File

@@ -1,5 +1,5 @@
REM2HTML
$Id: README.rem2html,v 1.2 1997-08-31 17:03:45 dfs Exp $
$Id: README.rem2html,v 1.3 1998-01-24 03:20:11 dfs Exp $
Rem2HTML is a Perl script which transforms the output of
`remind -p ...' to an HTML table. Type `perl rem2html --help' for
@@ -10,6 +10,13 @@ Typical usage: remind -p ~/.reminders | rem2html > file.html
You may have to edit the "#!/bin/perl" line to reflect the location
of your Perl interpreter.
If you make Remind output data for more than one month (for example,
remind -p3 ~/.reminders | rem2html > file.html), then rem2html
creates a _SINGLE_ file of concatenated HTML documents. It's up
to you to split them. In this case, you're probably better off
using the --tableonly option to rem2html and adding the appropriate
head and tail with another program.
Rem2HTML was contributed by Don Schwarz <darkowl@mcs.net>. It
produces HTML compatible with most modern browsers, but *not* with
browsers which don't support tables (like Lynx, as of this writing.)

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 ) {