#!/bin/sh

#clean up existing
rm *.html *.png *.PNG *.jpg *.JPG *.gif *.GIF *.htm *.css *.js *.bidon *.ico

#get page, prereqs, etc and convert links
wget -p -k -nd -E -e "robots=off" http://cserg0.site.uottawa.ca/twiki/bin/view/ProjetSEG/HelpOnLine?skin=plain

#prepare temp file
mv ./Help*.html ./helponline_TMP.html 

#remove <BASE> tags from file
grep -iv "<base" ./helponline_TMP.html > ./helponline2_TMP.html 

#make table of content's links local links
#sed 's/http:\/\/cserg0.site.uottawa.ca\/twiki\/bin\/view\/ProjetSEG\/HelpOnLine//' < helponline2_TMP.html > helponline.html 
sed 's/HelpOnLine\@skin\=plain.html//' < helponline2_TMP.html > helponline.html 

#cleanup
rm *_TMP* 

#don't forget that the file must not contain base and it must be valid xhtml
