# Makefile to compile the html manual

# this worked using a modified version of SgmlTools and some 
# minor hacks on the linuxdoc.dtd and perl formatting instructions.
# I think those hacks have been irrecoverably lost


#default location to put the html pages
HTMLLOC=/home/montserrat/ddb/HTML/xtal-man
HTMLDEVLOC=/home/montserrat/ddb/HTML/xtl
HTMLLIMBOLOC=/home/montserrat/ddb/HTML/xtl-old

#default action is to make all

default:
	@echo ' '
	@echo 'Please type "make manual", where manual is one of:'
	@echo '                     html   (for web pages)'
	@echo '                     info   (for info manual pages)'
	@echo '                     latex  (for latex and ps pages)'
	@echo '                     lyx    (for lyx pages)'
	@echo '                     rtf    (for rich text format pages)'
	@echo '                     txt    (for plain text pages)'
	@echo '         '
	@echo '                     dev     (for the developers manual in html)'
	@echo '                     devweb  (update the developers manual on the website)'
	@echo '                     limbo   (for the limbo manual in html)'
	@echo '                     limweb  (update the limbo manual on the website)'

#all:	html
all:	dev

website:
	rm -r /home/web/Xtal/man/xtal*-*.html
	cp $(HTMLLOC)/*-*.html /home/web/Xtal/man/

cd:
	rm -r /home/montserrat/ddb/xtaldv/cd/www/Crystal/xtal/man/xtal*-*.html
	cp $(HTMLLOC)/*-*.html /home/montserrat/ddb/xtaldv/cd/www/Crystal/xtal/man/

html:	xtal3.6.html
	rm xtal3.6.html

info:	xtal3.6.info

xtal3.6.html:	xtal3.6.sgml
	sgml2html -s 2 xtal3.6.sgml
	upgrade xtal3.6 *-*.html
	rm -f ./*.bak
	rm -f $(HTMLLOC)/*-*.html
	mv -f -- *-*.html  $(HTMLLOC)/
   
dev:    xtaldev.html

xtaldev.html:	xtaldev.sgml
	sgml2html -s 2 xtaldev.sgml
	rm -f $(HTMLDEVLOC)/*.html
	mv -f -- xtaldev*.html  $(HTMLDEVLOC)/

devweb :   
	rm -r /home/web/Xtal/rfpp/xtaldev*.html
	cp $(HTMLDEVLOC)/*.html /home/web/Xtal/rfpp/



limbo:    limbo.html
	rm -f limbo.html

limbo.html:	limbo.sgml
	sgml2html -s 2 limbo.sgml
	postplimbo.pl limbo *-*.html
	rm -f ./*.bak
	rm -f $(HTMLLIMBOLOC)/*-*.html
	mv -f -- limbo*-*.html  $(HTMLLIMBOLOC)/

limweb :    
	rm -r /home/web/Xtal/limbo/limbo*.html
	cp $(HTMLLIMBOLOC)/*.html /home/web/Xtal/limbo/



xtal3.6.info:	xtal3.6.sgml
	sgml2info --papersize=a4 --language=english --verbose --debug --charset=latin  xtal3.6.sgml
#	upgrade xtal3.6 *-*.html
#	rm -f ./*.bak
#	rm -f $(HTMLLOC)/*-*.html
#	mv -f -- *-*.html  $(HTMLLOC)/
   

# this does not touch the title page - xtal.html at all
# and I want to keep it that way. I am not happy with the way
# SGML-tools trashes the title/contents page



###################################################################
#To whom it may concern: 
#
#The xtal manual was originally written 
#using the Nuntius word processor on the macintosh.
#The document was exported as a  microsoft word 3.1 document.
#It was imported into word6.0 on the mac and saved as a word 6.0 doc.
#It was transferred to a PC running microsoft word 97 and saved in RTF format
#It was transferred to a unix machine as RTF.
#It was converted to HTML using rtf2html - a share ware program on free trial.
#It was then converted to sgml using html2sgml.pl - a perlscript
#   converter configured for the Linuxdoc.dtd for sgml.
#
#It then required  considerable filtering  with 
#perl substitution scripts  not to mention sheer manual labour 
#to assemble a final document that  could be parsed by "nsgmls"
#
#
#Supposedly it can now be edited with vi (or using emacs with sgml extensions)
#and converted to latex, html, man pages, and rtf formats using the 
#sgml-tools package under linux.
#
#The rtf files may then be compiled into online help for the PC version.
#
#
#Hopefully it will all be worth it.
#
#To generate HTML files and post format them , simply execute the 
#"run_me"  shell script file (in this directory and on  Stlucia)
#
#View the resultant html online at: 
#
#http://www.crystal.uwa.edu.au/~ddb/xtal/xtal.html
#
#
#
#!/bin/perl -pi.bak
# this is an example perl script showing some of the substituions involved 
# should anyone wish to convert more of the pre 3.4  manual versions

#s/<BODY [^>]*>/ /ig  ;                # <BODY ....>  ignore
#s/<center><bf>Authors/<bf>Authors/ig ;
#s/<center><bf>Contact/<bf>Contact/ig ;
#s/<center><bf>/<sect2>/ig ;
#s/<center><tt>/<sect1><tt>/ig ;
#s/<\/bf><\/center>/<p>/ig ;
#s/<center>/ /ig ;                     # ignore any other <center>
#s/<\/center>/ /ig ;                   # ignore any other trailing </center>
#s/\<cite\>/\<sf\>/ig ;                # <cite> -> <sans serif>
#s/<\/cite>/<\/sf>/ig ;
#s/\<u\>/\<sl\>/ig ;                   # <u> -> <slant>
#s/\<\/u\>/\<\/sl\>/ig ;
#s/\<sub\>/\<inf\>/ig  ;               # <sub> -> <inf>
#s/\<\/sub\>/<\/inf\>/ig  ;

#s/( *[a-zA-Z]*)\<inf\>([0-9a-zA-Z]*)\<\/inf\>/\[$1\<inf\>$2\<\/inf\>\]/ig ;
#s/( *[a-zA-Z]*)\<sup\>([0-9a-zA-Z]*)\<\/sup\>/\[$1\<sup\>$2\<\/sup\>\]/ig ;
#s/\]\[//ig ;
#s/\[\[/\[/ig ;
#s/\]\]/\]/ig ;

#s/<sup><bf>([ 0-9a-zA-Z]*)<\/bf><\/sup>/\[<sup>$1<\/sup>\]/ig ;
#s/<sup><bf>([0-9]*,[0-9]*)<\/bf><\/sup>/\[<sup>$1<\/sup>\]/ig ;
#s/<sup>([ \t]*)<\/sup>/ /ig ;



