mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 06:48:47 +02:00
-- Updated WHATSNEW.30
-- Updated Remind.1 man page -- Made rem2html escape special HTML characters -- Made Remind parser more forgiving. (!)
This commit is contained in:
@@ -36,10 +36,16 @@ CHANGES TO REMIND
|
||||
|
||||
- Directory structure totally reorganized. Remind now uses an autoconf
|
||||
"configure" script which should make life very pleasant for UNIX
|
||||
people.
|
||||
people.
|
||||
|
||||
- Made rem2html work properly if more than one month's worth of calendar
|
||||
data was produced.
|
||||
- Made Rem2HTML work properly if more than one month's worth of calendar
|
||||
data was produced. Rem2HTML also escapes any special HTML characters.
|
||||
However, it recognizes a "SPECIAL HTML" type of reminder which lets
|
||||
you put arbitrary HTML code in your calendar entries. See www/rem2html
|
||||
for details.
|
||||
|
||||
- Added the "-a" option to Rem2HTML to complement the "-p" option. Also
|
||||
made Rem2HTML print a usage message if input is coming from a terminal.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
|
||||
11
man/remind.1
11
man/remind.1
@@ -1,4 +1,4 @@
|
||||
.\" $Id: remind.1,v 1.4 1998-02-10 04:11:39 dfs Exp $
|
||||
.\" $Id: remind.1,v 1.5 1998-02-12 03:32:11 dfs Exp $
|
||||
.TH REMIND 1 "1 February 1998"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
@@ -298,6 +298,15 @@ used the \fB\-k\fR command-line option, then \fBMSG\fR-type reminders are
|
||||
passed to the appropriate program. Note that the options \fB\-c\fR,
|
||||
\fB\-s\fR, \fB\-p\fR and \fB\-n\fR disable the \fB\-k\fR option.
|
||||
.PP
|
||||
Note that you can omit the reminder type, in which case it
|
||||
defaults to \fBMSG\fR. So you can write:
|
||||
.PP
|
||||
.nf
|
||||
6 January David's Birthday
|
||||
.fi
|
||||
.PP
|
||||
although this is not recommended.
|
||||
.PP
|
||||
The \fBMSF\fR keyword is almost the same as the \fBMSG\fR keyword,
|
||||
except that the reminder is formatted to fit into a paragraph-like
|
||||
format. Three system variables control the formatting of \fBMSF\fR-type
|
||||
|
||||
45
src/token.c
45
src/token.c
@@ -11,7 +11,7 @@
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: token.c,v 1.4 1998-02-10 03:15:55 dfs Exp $";
|
||||
static char const RCSID[] = "$Id: token.c,v 1.5 1998-02-12 03:32:16 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -115,24 +115,24 @@ Token NonEnglishToks[] = {
|
||||
/* NAME MINLEN TYPE VALUE */
|
||||
|
||||
{ L_MONDAY, 3, T_WkDay, 0 },
|
||||
{ L_TUESDAY, 3, T_WkDay, 1 },
|
||||
{ L_WEDNESDAY, 3, T_WkDay, 2 },
|
||||
{ L_THURSDAY, 3, T_WkDay, 3 },
|
||||
{ L_TUESDAY 3, T_WkDay, 1 },
|
||||
{ L_WEDNESDAY 3, T_WkDay, 2 },
|
||||
{ L_THURSDAY 3, T_WkDay, 3 },
|
||||
{ L_FRIDAY, 3, T_WkDay, 4 },
|
||||
{ L_SATURDAY, 3, T_WkDay, 5 },
|
||||
{ L_SATURDAY, 3, T_WkDay, 5 },
|
||||
{ L_SUNDAY, 3, T_WkDay, 6 },
|
||||
{ L_JAN, 3, T_Month, 0 },
|
||||
{ L_FEB, 3, T_Month, 1 },
|
||||
{ L_MAR, 3, T_Month, 2 },
|
||||
{ L_APR, 3, T_Month, 3 },
|
||||
{ L_MAY, 3, T_Month, 4 },
|
||||
{ L_JUN, 3, T_Month, 5 },
|
||||
{ L_JUL, 3, T_Month, 6 },
|
||||
{ L_AUG, 3, T_Month, 7 },
|
||||
{ L_SEP, 3, T_Month, 8 },
|
||||
{ L_OCT, 3, T_Month, 9 },
|
||||
{ L_NOV, 3, T_Month, 10 },
|
||||
{ L_DEC, 3, T_Month, 11 }
|
||||
{ L_JAN, 3, T_Month, 0 },
|
||||
{ L_FEB, 3, T_Month, 1 },
|
||||
{ L_MAR, 3, T_Month, 2 },
|
||||
{ L_APR, 3, T_Month, 3 },
|
||||
{ L_MAY, 3, T_Month, 4 },
|
||||
{ L_JUN, 3, T_Month, 5 },
|
||||
{ L_JUL, 3, T_Month, 6 },
|
||||
{ L_AUG, 3, T_Month, 7 },
|
||||
{ L_SEP, 3, T_Month, 8 },
|
||||
{ L_OCT, 3, T_Month, 9 },
|
||||
{ L_NOV, 3, T_Month, 10 },
|
||||
{ L_DEC, 3, T_Month, 11 }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -210,6 +210,11 @@ Token *tok;
|
||||
}
|
||||
|
||||
l = strlen(s);
|
||||
|
||||
/* Ignore trailing commas */
|
||||
if (l > 0 && s[l-1] == ',') {
|
||||
l--;
|
||||
}
|
||||
bot = 0;
|
||||
top = sizeof(TokArray) / sizeof(TokArray[0]) - 1;
|
||||
|
||||
@@ -359,12 +364,14 @@ char *s;
|
||||
{
|
||||
register int r;
|
||||
char *tk = t->name;
|
||||
while(*tk && *s) {
|
||||
while(*tk && *s && !(*s == ',' && *(s+1) == 0)) {
|
||||
r = UPPER(*tk) - UPPER(*s);
|
||||
tk++;
|
||||
s++;
|
||||
if (r) return r;
|
||||
}
|
||||
if (!*s) return 0;
|
||||
/* Ignore trailing commas on s */
|
||||
|
||||
if (!*s || (*s == ',' && !*(s+1))) return 0;
|
||||
return (*tk - *s);
|
||||
}
|
||||
|
||||
36
www/rem2html
36
www/rem2html
@@ -2,7 +2,7 @@
|
||||
|
||||
# rem2html
|
||||
#
|
||||
# $Id: rem2html,v 1.5 1998-01-24 03:20:11 dfs Exp $
|
||||
# $Id: rem2html,v 1.6 1998-02-12 03:32:17 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
|
||||
@@ -17,7 +17,17 @@
|
||||
# [Note from David: The REMIND license prohibits you from using REMIND
|
||||
# under Windows.]
|
||||
#
|
||||
# This file is Copyright (C) 1997 by Don Schwarz <darkowl@mcs.net>.
|
||||
# Rem2html puts "normal" CAL or MSG-type reminders in a <P></P> pair,
|
||||
# and escapes any special HTML characters.
|
||||
#
|
||||
# If you want to put actual HTML code in the calendar (hyper-links, for
|
||||
# example), use the "SPECIAL HTML" type. For example:
|
||||
#
|
||||
# REM Wed SPECIAL HTML <P> Meeting at \
|
||||
# <A HREF="http://www.linuxhq.org">Linux HQ</A> </P>
|
||||
#
|
||||
# This file is Copyright (C) 1997-8 by Don Schwarz <darkowl@mcs.net>
|
||||
# and David F. Skoll
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
@@ -27,6 +37,11 @@ $rem2html_version = "1.0";
|
||||
|
||||
&parse_options();
|
||||
|
||||
if (-t STDIN) {
|
||||
print STDERR "(Rem2HTML: Input should not come from a terminal.)\n";
|
||||
$Options{'help'} = 1;
|
||||
}
|
||||
|
||||
if ($Options{'help'}) {
|
||||
&show_usage();
|
||||
} elsif ($Options{'version'}) {
|
||||
@@ -57,6 +72,7 @@ Options:
|
||||
--version Version information
|
||||
-p file Prepend the specified HTML file to the beginning of the
|
||||
output
|
||||
-a file Append the specified HTML file to the end of the output
|
||||
-f[shted] font Set font for small cal, hdr, title, cal entries,day numbers
|
||||
-s[hted] size Set size for header, title, calendar entries and/or day
|
||||
numbers
|
||||
@@ -72,6 +88,14 @@ EndOfUsage
|
||||
|
||||
}
|
||||
|
||||
sub escape_html {
|
||||
my($in) = @_;
|
||||
$in =~ s/\&/\&/g;
|
||||
$in =~ s/\</\</g;
|
||||
$in =~ s/\>/\>/g;
|
||||
return $in;
|
||||
}
|
||||
|
||||
sub parse_options {
|
||||
%Options = ();
|
||||
|
||||
@@ -82,6 +106,7 @@ sub parse_options {
|
||||
"backurl|bu:s", "forwurl|fu:s",
|
||||
"tableonly|to",
|
||||
"prologue|p=s",
|
||||
"append|a=s",
|
||||
"bgcolor|g=s",
|
||||
"fs=s", "fh=s", "ft=s", "fe=s", "fd=s",
|
||||
"sh=i", "st=i", "se=i", "sd=i",
|
||||
@@ -125,6 +150,7 @@ sub parse_input {
|
||||
if ($type eq "HTML") {
|
||||
$days[$day] .= "$msg ";
|
||||
} else {
|
||||
$msg = &escape_html($msg);
|
||||
$days[$day] .= "<P>$msg</P>";
|
||||
}
|
||||
}
|
||||
@@ -179,6 +205,12 @@ EndOfHTML
|
||||
sub output_footer {
|
||||
print "</TABLE>\n";
|
||||
|
||||
if ($Options{'append'}) {
|
||||
open(EPILOGUE, "< $Options{'append'}");
|
||||
print while ( <EPILOGUE> );
|
||||
close(EPILOGUE);
|
||||
}
|
||||
|
||||
unless ($Options{'tableonly'}) {
|
||||
print <<EndOfHTML;
|
||||
</BODY>
|
||||
|
||||
Reference in New Issue
Block a user