blob: 051ce1b75a6503011271ec0ef8bbbd69cc636918 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
#!/bin/sh
processline()
{
echo "- $1 -"
name="$1"
anchors="<A NAME=\"$1\"></A>"
title=""
stylesheet="../style/xaoshelp.css"
shift
while [ "$1" != "" ] ; do
if [ "$1" != "$name" ] ; then
anchors="$anchors <A NAME=\"$1\"></A>"
fi
shift
done
if [ "$name" == "main" ]; then
title='<meta name="AppleTitle" content="XaoS Help">'
stylesheet="style/xaoshelp.css"
fi
# I changed "0" to "$" because my sed
# doesn't want to understand "0".
# -- Zoltan
cat xaos.hlp | sed '/%'"$name"'/H' | sed '1,/%'"$name"'/d;/^%/,$ d' | sed \
'1,3s_<head>\([^<]*\)</head>_\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\
<HTML>\
<HEAD>\
<TITLE>\1</TITLE>\
'"$title"'\
<LINK HREF="'"$stylesheet"'" REL="stylesheet" TYPE="text/css">\
</HEAD>\
<BODY>\
'"$anchors"'\
<H1>\1</H1>\
_g
s_<head>_<H2>_g
s_</head>_</H2>_g
s_<center>__g
s_</center>__g
s_<emph>_<STRONG>_g
s_<submenu>__g
s_<menuhead>__g
s_</menuhead>__g
s_<mainmenu>__g
s_<main>__g
s_<math>__g
s_<menuitems>__g
s_<notex>__g
s_</notex>__g
s_<node.*>__g
s_</emph>_</STRONG>_g
s_<tt>_<CODE>_g
s_</tt>_</CODE>_g
s_<tutor \([^>]*\)>_<A HREF="help:runscript=/scripts/tutorial.scpt%20string=\1">_g
s_</tutor>_</A>_g
s_<a \([^>]*\)>_<A HREF="help:anchor=\1 bookID=XaoS Help">_g
s/'\'\''/"/g
s/``/"/g' > $name.html
echo "</BODY></HTML>" >> $name.html
tidy -qm $name.html
case $name in
main) mv $name.html XaoSHelp/XaoSHelp.html;;
*) mv $name.html XaoSHelp/pages;;
esac
}
process()
{
while read line ; do
eval "processline $line"
done
}
rm -rf XaoSHelp
mkdir -p XaoSHelp/{images,pages,scripts,style}
cp tutorial.scpt XaoSHelp/scripts
cp xaoshelp.css XaoSHelp/style
grep "^%" xaos.hlp | sed '/%%/d;s/%//g' | process
/Developer/Applications/Utilities/Help\ Indexer.app/Contents/MacOS/Help\ Indexer "XaoSHelp" -PantherIndexing YES -IndexAnchors YES -TigerIndexing YES
|