-
Notifications
You must be signed in to change notification settings - Fork 21
/
create_index
executable file
·93 lines (71 loc) · 1.27 KB
/
create_index
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
#!/bin/sh
# CoLoR, a Coq library on rewriting and termination.
# See the COPYRIGHTS and LICENSE files.
#
# - Frederic Blanqui, 2006-01-16
prog=`basename $0`
usage () {
echo "usage: $prog [-h]"
}
help () {
cat <<EOF
Creates an index for CoLoR files in doc/main.html.
Options:
-h Provide this help and exit
EOF
}
case "$1" in
-h) usage; echo; help; exit 0;;
esac
if test $# -ne 0
then
usage; exit 1
fi
doc=`pwd`/doc/main.html
# add an entry for each file of $dir
prfiles () {
echo "<li>$dir<ul>" >> $doc
for f in `ls $dir/*.v`
do
if test "$root" = ""
then
d=$dir
else
d=$root.$dir
fi
g=`basename $f .v`
echo "<li><a href=\"CoLoR.$d.$g.html\">$g</a></li>" >> $doc
done
echo "</ul></li>" >> $doc
}
# add an entry for each $subdirs of $root
prdir () {
echo "<li>$root<ul>" >> $doc
cd $root
for d in $subdirs
do
dir=$d; prfiles
done
cd ..
echo "</ul></li>" >> $doc
}
# begin
cat doc/begin.html > $doc
echo "<ul>" >> $doc
# Util
root=Util
subdirs=`ls -1 $root`
prdir
# Term
root=Term
subdirs=`ls -1 $root`
prdir
# simple directories
root=''
for dir in Conversion DP Filter HORPO MannaNess MatrixInt MPO NonTermin PolyInt ProofChecker RPO SemLab
do
prfiles
done
# end
echo "</ul>" >> $doc
cat doc/end.html >> $doc