forked from AreaScout/vice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfixdox.sh
More file actions
executable file
·128 lines (111 loc) · 2.04 KB
/
fixdox.sh
File metadata and controls
executable file
·128 lines (111 loc) · 2.04 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/sh
# fixdox.sh - This script will fix up the texi file for proper
# generation of the final document.
#
# input is stdin and output is stdout.
#
# written by Marco van den Heuvel <blackystardust68@yahoo.com>
#
# fixdox.sh <format-to-fix-for>
# $1
FORMAT=$1
table4chm()
{
rm -f chmtmp*.txt
read data
newdata=""
for i in $data
do
if test x"$i" != "x@item"; then
newdata="$newdata $i"
fi
done
echo >>chmtmp.txt "@multitable $newdata"
read data
while test x"$data" != "x@end multitable"
do
echo >>chmtmp.txt "$data"
read data
done
sed 's/@item/@rowstart/g' <chmtmp.txt >chmtmp2.txt
cat chmtmp2.txt
rm -f chmtmp*.txt
}
fixtxt()
{
while read data
do
if test x"$data" != "xSTART-INFO-DIR-ENTRY" -a x"$data" != "xEND-INFO-DIR-ENTRY"; then
echo "$data"
else
if test x"$data" = "xSTART-INFO-DIR-ENTRY"; then
read data
header=""
for i in $data
do
if test x"$header" != "x"; then
header="$header $i"
fi
if test x"$header" = "x" -a x"$i" = "x(vice)."; then
header=" "
fi
done
echo $header
fi
fi
done
}
fixchm()
{
outputok=yes
while read data
do
case x"${data}" in
"x@multitable"*) table4chm;;
esac
if test x"$data" = "x@ifinfo"; then
outputok=no
fi
if test x"$outputok" = "xyes"; then
echo $data
fi
if test x"$data" = "x@end ifinfo"; then
outputok=yes
fi
done
}
fixhlp()
{
sed <tmp.texi >vicetmp.texi -e 's/@firstparagraphindent none//g' -e 's/@exampleindent 0//g'
rm -f -r tmp.texi
}
fixguide()
{
echo not implemented yet
}
fixpdf()
{
echo not implemented yet
}
fixipf()
{
echo not implemented yet
}
if test x"$FORMAT" = "xtxt"; then
fixtxt
fi
if test x"$FORMAT" = "xchm"; then
fixchm
fi
if test x"$FORMAT" = "xhlp"; then
fixhlp
fi
if test x"$FORMAT" = "xguide"; then
fixguide
fi
if test x"$FORMAT" = "xpdf"; then
fixpdf
fi
if test x"$FORMAT" = "xipf"; then
fixipf
fi