Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/help/dokuwikiconv
blob: 83a75c737717b8611b56d6372a6b6f8e266e71ff (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
78
79
80
81
82
#!/bin/sh
processline()
{
	echo "- $1 -"
	name="$1"
	# I changed "0" to "$" because my sed
	# doesn't want to understand "0".
	# -- Zoltan
	cat xaos.hlp | sed '1,/%'"$1"'/d;/^%/,$ d' | sed \
's_<p><tt>_<code>_g
s_</tt><p>_</code>_g
s/'\'\''/"/g
s/``/"/g
s_LICENSE<p>_LICENSE - _g' | sed \
'1,2s_<head>\([^<]*\)</head>_====== \1 ======\
_g
s_<emph>_**_g
s_<p>_\
_g
s_<head>_===== _g
s_</head>_ =====\
_g
s_<center>__g
s_</center>__g
s_<i>_//_g
s_</i>_//_g
s_<submenu>__g
s_<menuhead>__g
s_</menuhead>__g
s_<mainmenu>__g
s_<menuitems>__g
s_</menuitems>__g
s_<notex>__g
s_</notex>__g
s_<dl>__g
s_</dl>__g
s_<dd>__g
s_</dd>__g
s_<br>_\
_g
s_ [ ]*_ _g
s_<math>_//_g
s_</math>_//_g
s_<dt>_  * _g
s_</dt>__g
s_<node.*>__g
s_</emph>_**_g
s_<tt>_'\'\''_g
s_</tt>_'\'\''_g
s_<tutor [^>]*>_//_g
s_</tutor>_//_g
s_<a \([^>]*\)>_[[\1|_g
s_</a>_]]_g' > $1.txt

	tolower=`echo $1 | awk '{print tolower($1)}'`
	if [ "$1" != "$tolower" ] ; then
	 ln -sf $1.txt $tolower.txt
	fi 

	shift
	while [ "$1" != "" ] ; do
	  echo Link "$1" "$name"
	  if [ "$1" != "$name" ] ; then
	    ln -sf $name.txt $1.txt
          fi

	  tolower=`echo $1 | awk '{print tolower($1)}'`
	  if [ "$1" != "$tolower" ] ; then
	   ln -sf $1.txt $tolower.txt
	  fi 


	  shift
	done
}
process()
{
	while read line ; do
		eval "processline $line"
	done
}
grep "^%" xaos.hlp | sed '/%%/d;s/%//g' | process