-- Made the SHADE and MOON specials work in rem2html.

-- Added little moon icons.
This commit is contained in:
dfs
1998-04-23 02:57:06 +00:00
parent 85c5dc6d26
commit e0129313c4
7 changed files with 76 additions and 19 deletions

View File

@@ -2,7 +2,7 @@
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: Makefile,v 1.7 1997-08-31 17:17:51 dfs Exp $
# $Id: Makefile,v 1.8 1998-04-23 02:57:06 dfs Exp $
# The complete name of your www host. Example: www.mycompany.com
WWWHOST = shevy.skoll.ca
@@ -13,7 +13,7 @@ WWWHOST = shevy.skoll.ca
SCRIPTDIR = /var/web/cgi-bin
# SCRIPTDIR = /home/dfs/Remind/www/TEST
# Where the scripts live as seen from the outside world. If
# Where the scripts live as seen by the web browser. If
# they live in WWWHOST/cgi-bin, supply /cgi-bin
CGIDIR = /cgi-bin
@@ -22,6 +22,12 @@ CGIDIR = /cgi-bin
# path as seen by the UNIX operating system
HTMLDIR = /home/dfs/public_html
# Where you stick images, as seen by UNIX
IMAGEDIR = /home/dfs/public_html
# Where images are, as seen by web browers
IMAGEBASE = /~dfs
# Location. Typically, the name of your city or town. Example: Ottawa
LOCATION = Ottawa
# LOCATION = New York
@@ -38,6 +44,7 @@ SEDSCRIPT = -e 's/Ottawa/$(LOCATION)/g' \
-e 's@http://your.machine/your.dir@http://$(WWWHOST)$(CGIDIR)@g' \
-e 's@%SCRIPTDIR%@$(SCRIPTDIR)@g' \
-e 's@%REMIND%@$(REMIND)@g' \
-e 's@%IMAGEBASE%@$(IMAGEBASE)@g' \
-e 's@%REM2PS%@$(REM2PS)@g'
all:
@@ -53,12 +60,21 @@ install:
sed $(SEDSCRIPT) < sunrise.rem-DIST > $(SCRIPTDIR)/sunrise.rem
sed $(SEDSCRIPT) < sunset.rem-DIST > $(SCRIPTDIR)/sunset.rem
sed $(SEDSCRIPT) < calendar.html-DIST > $(HTMLDIR)/calendar.html
sed $(SEDSCRIPT) < rem2html > $(SCRIPTDIR)/rem2html
chmod 644 $(SCRIPTDIR)/sunrise.rem
chmod 644 $(SCRIPTDIR)/moon.rem
chmod 644 $(SCRIPTDIR)/hebdate.rem
chmod 644 $(SCRIPTDIR)/sunset.rem
chmod 644 $(HTMLDIR)/calendar.html
chmod 755 $(SCRIPTDIR)/cal_dispatch
chmod 755 $(SCRIPTDIR)/rem2html
chmod 755 $(SCRIPTDIR)/calps $(SCRIPTDIR)/hebdate \
$(SCRIPTDIR)/hebps $(SCRIPTDIR)/moon $(SCRIPTDIR)/sunrise \
$(SCRIPTDIR)/sunset $(SCRIPTDIR)/hebhtml $(SCRIPTDIR)/rem2html
cp firstquarter.gif fullmoon.gif lastquarter.gif newmoon.gif $(IMAGEDIR)
chmod 644 $(IMAGEDIR)/firstquarter.gif $(IMAGEDIR)/fullmoon.gif $(IMAGEDIR)/lastquarter.gif $(IMAGEDIR)/newmoon.gif

BIN
www/firstquarter.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

BIN
www/fullmoon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

View File

@@ -3,7 +3,7 @@
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: hebdate.rem-DIST,v 1.4 1998-02-16 02:21:45 dfs Exp $
# $Id: hebdate.rem-DIST,v 1.5 1998-04-23 02:57:07 dfs Exp $
BANNER %
IF !$PSCAL
@@ -162,18 +162,12 @@ IF !$PSCAL
REM 20 ++40 msg Also available: <a HREF="http://your.machine/your.dir/cal_dispatch?hebps">a PostScript calendar</a> (about 35KB) for %m %y, complete with Hebrew dates, Jewish holidays, and moon phases for Ottawa. (This takes a few seconds to generate.)
REM 20 ++40 msg And: <a HREF="http://your.machine/your.dir/cal_dispatch?hebhtml">an HTML version</a> of the above. (No moons, and your browser must handle tables.)
ELSE
IF !HTML
REM Sat PS [psshade(95)]
[trigger(moondate(0))] PS [psmoon(0)]
[trigger(moondate(1))] PS [psmoon(1)]
[trigger(moondate(2))] PS [psmoon(2)]
[trigger(moondate(3))] PS [psmoon(3)]
[trigger(moondate(0))] SPECIAL MOON 0
[trigger(moondate(1))] SPECIAL MOON 1
[trigger(moondate(2))] SPECIAL MOON 2
[trigger(moondate(3))] SPECIAL MOON 3
REM PS Border Border moveto /DayFont findfont 10 scalefont setfont ([hebday(today())] [hebmon(today())]) show
ELSE
[trigger(moondate(0))] SPECIAL HTML <P><FONT SIZE=-2>New Moon</FONT></P>
[trigger(moondate(2))] SPECIAL HTML <P><FONT SIZE=-2>Full Moon</FONT></P>
REM SPECIAL HTML <P><FONT SIZE=-1>[hebday(today())] [hebmon(today())]</FONT></P>
ENDIF
ENDIF

BIN
www/lastquarter.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

BIN
www/newmoon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

View File

@@ -2,7 +2,7 @@
# rem2html
#
# $Id: rem2html,v 1.6 1998-02-12 03:32:17 dfs Exp $
# $Id: rem2html,v 1.7 1998-04-23 02:57:08 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
@@ -33,6 +33,11 @@ use Getopt::Long;
@months = (January,February,March,April,May,June,July,August,September,October,November,December);
$DefaultImageDir = "%IMAGEBASE%";
if ($DefaultImageDir =~ m@/$@) {
chop $DefaultImageDir;
}
$rem2html_version = "1.0";
&parse_options();
@@ -123,7 +128,8 @@ sub parse_input {
local $type;
local $day;
@days = ();
@shades = ();
@moons = ();
while (<>) {
chomp($_);
if (/rem2(html|ps) begin/) {
@@ -146,10 +152,51 @@ sub parse_input {
$type = $4;
$msg = $8;
$day = $3;
next unless ($type eq "HTML" || ($type eq "*"));
if ($type eq "HTML") {
$days[$day] .= "$msg ";
} else {
} elsif ($type eq "MOON") {
my($phase, $text);
if ($msg =~ /^\s*(\d+)\s+\S+\s+\S+\s+(.*)$/) {
$phase = $1;
$text = $2;
} elsif ($msg =~ /^\s*(\d+)/) {
$phase = $1;
$text = "";
} else {
next;
}
next if ($phase > 3);
if ($phase == 0) {
$text = "<P ALIGN=RIGHT><IMAGE SRC=\"$DefaultImageDir/newmoon.gif\" ALT=\"New Moon\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
} elsif ($phase == 1) {
$text = "<P ALIGN=RIGHT><IMAGE SRC=\"$DefaultImageDir/firstquarter.gif\" ALT=\"First Quarter\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
} elsif ($phase == 2) {
$text = "<P ALIGN=RIGHT><IMAGE SRC=\"$DefaultImageDir/fullmoon.gif\" ALT=\"Full Moon\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
} else {
$text = "<P ALIGN=RIGHT><IMAGE SRC=\"$DefaultImageDir/lastquarter.gif\" ALT=\"Last Quarter\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
}
$moons[$day] = $text . "</FONT> ";
} elsif ($type eq "SHADE") {
my($red, $green, $blue);
if ($msg =~ /^\s*(\d+)\s+(\d+)\s+(\d+)\s*$/) {
$red = $1;
$green = $2;
$blue = $3;
} elsif ($msg =~ /^\s*(\d+)\s*$/) {
$red = $1;
$green = $1;
$blue = $1;
} else {
next;
}
next if ($red > 255 || $green > 255 || $blue > 255);
$shades[$day] = sprintf(" BGCOLOR=\"#%02X%02X%02X\"",
$red, $green, $blue);
} elsif ($type eq "*") {
$msg = &escape_html($msg);
$days[$day] .= "<P>$msg</P>";
}
@@ -252,8 +299,8 @@ sub output_data {
if ($day > 0 && $day <= $month_length) {
print <<EndOfHTML;
<TD VALIGN=TOP WIDTH=14%>
<P ALIGN=RIGHT>$fday</P>
<TD VALIGN=TOP WIDTH=14%$shades[$day]>
<P ALIGN=RIGHT>$moons[$day]$fday</P>
$msg
</TD>
EndOfHTML