Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/help/applehelpconv
diff options
context:
space:
mode:
authorBernie Innocenti <bernie@codewiz.org>2010-05-03 21:53:47 (GMT)
committer Bernie Innocenti <bernie@codewiz.org>2010-05-03 21:53:47 (GMT)
commit1030dc837b10a03a02a85d5504cbeec168ce49e2 (patch)
tree698eefa87ac437deaf36a4141b326f8ce7986692 /help/applehelpconv
Import XaoS r489 (trunk after version 3.5)
Diffstat (limited to 'help/applehelpconv')
-rwxr-xr-xhelp/applehelpconv77
1 files changed, 77 insertions, 0 deletions
diff --git a/help/applehelpconv b/help/applehelpconv
new file mode 100755
index 0000000..051ce1b
--- /dev/null
+++ b/help/applehelpconv
@@ -0,0 +1,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