blob: 6248c7d0b36a47364e6c04978ce219ff92474bc9 (
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
|
#!/bin/sh
processline()
{
echo "- $1 -"
name="$1"
anchors="<object type=\"application/x-oleobject\" classid=\"clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e\"><param name=\"ALink Name\" value=\"$1\"></object>"
title=""
stylesheet="xaoshelp.css"
shift
while [ "$1" != "" ] ; do
if [ "$1" != "$name" ] ; then
anchors="$anchors <object type=\"application/x-oleobject\" classid=\"clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e\"><param name=\"ALink Name\" value=\"\$name\"></object>"
fi
shift
done
# 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 \([^>]*\)>_<strong>_g
s_</tutor>_</strong>_g
s_<a \([^>]*\)>_<A HREF="\1.html">_g
s/'\'\''/"/g
s/``/"/g' > $name.html
echo "</BODY></HTML>" >> $name.html
tidy -qm $name.html
case $name in
main) mv $name.html xaoshelp/index.html;;
*) mv $name.html xaoshelp;;
esac
}
process()
{
while read line ; do
eval "processline $line"
done
}
rm -rf xaoshelp
mkdir -p xaoshelp
cp xaoshelp.css xaoshelp
grep "^%" xaos.hlp | sed '/%%/d;s/%//g' | process
|