diff --git a/www/Makefile b/www/Makefile index dbdd2a5f..00efe75c 100644 --- a/www/Makefile +++ b/www/Makefile @@ -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 + + + + diff --git a/www/firstquarter.gif b/www/firstquarter.gif new file mode 100644 index 00000000..21d1f303 Binary files /dev/null and b/www/firstquarter.gif differ diff --git a/www/fullmoon.gif b/www/fullmoon.gif new file mode 100644 index 00000000..8d78eb37 Binary files /dev/null and b/www/fullmoon.gif differ diff --git a/www/hebdate.rem-DIST b/www/hebdate.rem-DIST index 07f48ff2..8b8934ac 100644 --- a/www/hebdate.rem-DIST +++ b/www/hebdate.rem-DIST @@ -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 PostScript calendar (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: an HTML version 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

New Moon

- [trigger(moondate(2))] SPECIAL HTML

Full Moon

REM SPECIAL HTML

[hebday(today())] [hebmon(today())]

-ENDIF ENDIF diff --git a/www/lastquarter.gif b/www/lastquarter.gif new file mode 100644 index 00000000..8184d1ac Binary files /dev/null and b/www/lastquarter.gif differ diff --git a/www/newmoon.gif b/www/newmoon.gif new file mode 100644 index 00000000..563ae1cb Binary files /dev/null and b/www/newmoon.gif differ diff --git a/www/rem2html b/www/rem2html index 7b7e862f..51a4b447 100755 --- a/www/rem2html +++ b/www/rem2html @@ -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 = "

\"New " . escape_html($text); + } elsif ($phase == 1) { + $text = "

\"First " . escape_html($text); + } elsif ($phase == 2) { + $text = "

\"Full " . escape_html($text); + } else { + $text = "

\"Last " . escape_html($text); + } + $moons[$day] = $text . " "; + } 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] .= "

$msg

"; } @@ -252,8 +299,8 @@ sub output_data { if ($day > 0 && $day <= $month_length) { print < -

$fday

+ +

$moons[$day]$fday

$msg EndOfHTML