#!/usr/local/bin/perl5 -w
#
AG2HTML.pl
# AG2HTML.pl Amiga Guide to HTML Converter
#
# This code is (c) 1993,1994,1995 to Michael Witbrock
# This code is 1993,1994,1995 to Michael Witbrock
# You may use it and modify and redistribute it freely,
# but you may not sell it in any way (including in disk collections)
# without first recieving my permission.
# Fred Fish, and the makers of the Aminet CD are granted that permission.
# If you significantly improve it, please let me know so that I can
# use the new version.
# You may contact me as witbrock@cs.cmu.edu
$VERSION = "2.951201";
($prog=$0) =~ s@.*\/([^/]+)@$1@;
print "$prog: version $VERSION\n";
#http://www.cs.cmu.edu/~mjw/Amiga/Perl/AG2HTML.pl
#is a URL to the latest version of this program.
# P.S. I know that this is redundant. It's my second perl script, and I don't
# yet know how to do subroutines. When I do, it will be both neater and shorter.
# P.P.S the reason it is preformatted is because many AG documents have button
# layouts which depend on this. Perhaps later I will make it smarter, so that
# it can recognise obvious text paragraphs and do the right thing.
# DONE: P.P.P.S handling some of the style flags, and the next, menu, prev, help, etc buttons
# is next, along with removing what can't be done (background colours etc).
#Changes: October 16 1993 MJW
# Allow email addresses.
# Translate & to & > to > < to <
#Changes: November the 9th 1993 MJW
# Allow some strange links that have strings after the link name
# found in Viewport
#Changes: March 12 1994 MJW
# Allow Link whereever I allow link -after Steve Gowdy's suggestion-
#Changes: April 22 1994 MJW
# Major rewrite?
# for Daniel Barrett, @{"mybutton" system "more myfile"} -> mybutton
# THE next version will handle pictures in AmigaReport files automatically, but that may be a few days off.
# Picture conversions done
# Automatic inlining of pictures done for ones like the following
#UNHANDLED?: @{"Lynx" system "display.s 10,100,AR215_pic1.iff,Lynx"} is a user-friendly hypertext interface on UNIX and VMS
#UNHANDLED?: The @{"Commodore Amiga Information Resource" system "display.s 10,100,AR215_pic2.iff,CAIR"} is a collection
#UNHANDLED?: - @{"Amiga Report" system "display.s 10,100,AR215_pic3.iff,AR on the WWW"}
#Changes May 28th 1994
# Amiga report changed to display like this:
# @{" AR Logo " system "display.s 650 100 AR217_pic2.iff Amiga_Report"}
# Change it to handle that too.
# June 9th ---- Changed pointer to itself
# June 18th ---- version numbers, so I can tell people when it changes
# June 28th ---- try to tolower links so they work for gowdy
# Nov 23 1994 Fixed to work under perl 5, but bug handling multiple links
# on one line persists! I wish they wouldn't do that.
# (fixed for Waldemar Zurowski)
#
# Nov 26 1994 Incorporated Bilbo (Waldemar)'s changes to handle multiple links
# in a line properly. Thanks Waldemar!.
#In real : Waldemar Zurowski
#email internet: WALDEK@PLEARN.EDU.PL or bilbo@ci.pwr.wroc.pl
#Bilbo
#
# Nov 26 1994 b. Fixed strange links with commas
# UNHANDLED?: @{" North America ", link P6-3-3}
# Nov 26 1994 c. Tidied up IFF handling
# Dec 01 1994 Hangle .guide .Guide etc (bug rept from Gael Marziou)
# Jan 23 1995 Waldemar Zurowski: Fix another capitalisation bug
# Feb 14 1995 Michael Witbrock : Fix yet another capitalisation bug!
# Nov 19 1995 Michael Witbrock : Correct HTML document structure
# Dec 01 1995 Michael Witbrock : Active URLs
sub handlenode{
while (){
chop;
if (m/\@[eE][nN][dD][Nn][oO][dD][Ee]/){
# print "Found \@endnode\n"; # found @endnode
print PAGEF "\n"; #
if ($buttonline ne "
") { print PAGEF "$buttonline"; }
print PAGEF "
HTML Conversion by AG2HTML.pl V${VERSION}, perl $] & witbrock\@cs.cmu.edu\n