diff --git a/scripts/tkremind b/scripts/tkremind index e8cf034b..1bb2ff45 100755 --- a/scripts/tkremind +++ b/scripts/tkremind @@ -11,7 +11,7 @@ # #-------------------------------------------------------------- -# $Id: tkremind,v 1.1 1998-01-15 02:50:21 dfs Exp $ +# $Id: tkremind,v 1.2 1998-01-24 03:20:01 dfs Exp $ # the next line restarts using wish \ exec wish "$0" "$@" @@ -273,8 +273,9 @@ proc FillCalWindow {} { gets $file line regexp {^([^ ]*) ([0-9][0-9][0-9][0-9]) ([0-9][0-9]?) ([0-9]) ([0-9])} $line dummy monthName year daysInMonth firstWkday mondayFirst + # Skip day names -- we already have them + gets $file line CreateCalWindow $firstWkday $mondayFirst $daysInMonth $monthName $year $DayNames - Status "Filling calendar entries..." while { [gets $file line] >= 0 } { if { [regexp {^([0-9][0-9][0-9][0-9])/([0-9][0-9])/([0-9][0-9]) +([^ ]+) +[^ ]+ +[^ ]+ +[^ ]+(.*)} $line all year month day type stuff] == 0 } { continue diff --git a/src/calendar.c b/src/calendar.c index c5ac6827..5ff0a8cc 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -10,7 +10,7 @@ /***************************************************************/ #include "config.h" -static char const RCSID[] = "$Id: calendar.c,v 1.2 1998-01-17 03:58:27 dfs Exp $"; +static char const RCSID[] = "$Id: calendar.c,v 1.3 1998-01-24 03:20:07 dfs Exp $"; #include #include @@ -209,6 +209,9 @@ static void DoCalendarOneMonth() printf("%s %d %d %d %d\n", MonthName[m], y, DaysInMonth(m, y), (JulianToday+1) % 7, MondayFirst); + printf("%s %s %s %s %s %s %s\n", + DayName[6], DayName[0], DayName[1], DayName[2], + DayName[3], DayName[4], DayName[5]); mm = m-1; if (mm<0) { mm = 11; yy = y-1; diff --git a/src/rem2ps.c b/src/rem2ps.c index 3259e4cf..4163753d 100644 --- a/src/rem2ps.c +++ b/src/rem2ps.c @@ -10,9 +10,8 @@ /***************************************************************/ #include "config.h" -static char const RCSID[] = "$Id: rem2ps.c,v 1.2 1998-01-17 03:58:32 dfs Exp $"; +static char const RCSID[] = "$Id: rem2ps.c,v 1.3 1998-01-24 03:20:07 dfs Exp $"; -#include "lang.h" #include #include #include @@ -53,7 +52,7 @@ typedef struct { int xsize, ysize; } PageType; -char Days[]=L_DAYINIT; +char DayName[7][33]; char *SmallCalLoc[] = { "", @@ -213,6 +212,12 @@ void DoPsCal() sscanf(LineBuffer, "%s %s %d %d %d", month, year, &days, &wkday, &MondayFirst); + /* Get day names */ + gets(LineBuffer); + sscanf(LineBuffer, "%32s %32s %32s %32s %32s %32s %32s", + DayName[0], DayName[1], DayName[2], DayName[3], + DayName[4], DayName[5], DayName[6]); + /* We write the prolog here because it's only at this point that MondayFirst is set correctly. */ if (validfile == 1) { @@ -419,12 +424,12 @@ void WriteProlog() for (i=0; PSProlog1[i]; i++) puts(PSProlog1[i]); if (!MondayFirst) printf("[(%s) (%s) (%s) (%s) (%s) (%s) (%s)]\n", - L_SUNDAY, L_MONDAY, L_TUESDAY, L_WEDNESDAY, - L_THURSDAY, L_FRIDAY, L_SATURDAY); + DayName[0], DayName[1], DayName[2], DayName[3], + DayName[4], DayName[5], DayName[6]); else printf("[(%s) (%s) (%s) (%s) (%s) (%s) (%s)]\n", - L_MONDAY, L_TUESDAY, L_WEDNESDAY, - L_THURSDAY, L_FRIDAY, L_SATURDAY, L_SUNDAY); + DayName[1], DayName[2], DayName[3], + DayName[4], DayName[5], DayName[6], DayName[0]); for (i=0; PSProlog2[i]; i++) puts(PSProlog2[i]); printf("/HeadFont /%s %s\n", HeadFont, isostuff); @@ -832,7 +837,7 @@ int days, first, col; for (i=0; i<7; i++) { if (MondayFirst) j=(i+1)%7; else j=i; - printf("Border %d SmallWidth mul add Border neg SmallFontSize sub SmallFontSize sub 2 sub moveto (%c) show\n", i, Days[j]); + printf("Border %d SmallWidth mul add Border neg SmallFontSize sub SmallFontSize sub 2 sub moveto (%c) show\n", i, DayName[j][0]); } /* Now do the days of the month */ diff --git a/www/README.rem2html b/www/README.rem2html index 6eea7d42..a771bb47 100644 --- a/www/README.rem2html +++ b/www/README.rem2html @@ -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 . It produces HTML compatible with most modern browsers, but *not* with browsers which don't support tables (like Lynx, as of this writing.) diff --git a/www/rem2html b/www/rem2html index b46f44f6..4e9dd648 100755 --- a/www/rem2html +++ b/www/rem2html @@ -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 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 " \n"; } @@ -253,13 +261,14 @@ sub small_calendar { 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 "\n"; for $week ( 0..5 ) {