1 |
#!/bin/sh |
2 |
|
3 |
if test "$#" -lt 3 ; then |
4 |
echo "Syntax: $0 psiconv_dir output_dir files..." |
5 |
exit 1 |
6 |
fi |
7 |
|
8 |
if ! test -d "$1"/psiconv ; then |
9 |
echo "First parameter should be base psiconv directory!" |
10 |
exit 1 |
11 |
fi |
12 |
basedir=`cd $1; pwd` |
13 |
|
14 |
if ! test -d "$2" ; then |
15 |
echo "Output directory does not exist!" |
16 |
exit 1 |
17 |
fi |
18 |
outputdir=`cd $2; pwd` |
19 |
|
20 |
|
21 |
shift |
22 |
shift |
23 |
echo "Generating html docs..." |
24 |
|
25 |
libtool=$basedir/libtool |
26 |
psiconv=$basedir/psiconv/psiconv |
27 |
indexfile=$outputdir/index |
28 |
tempdir=$outputdir/.temp |
29 |
mkindex=$basedir/formats/index_html.sh |
30 |
index=$tempdir/index |
31 |
mkdef=$basedir/formats/html_links.sh |
32 |
|
33 |
|
34 |
echo "Going to create the intermediate files..." |
35 |
rm -rf $tempdir |
36 |
mkdir $tempdir |
37 |
for file in "$@"; do |
38 |
echo "Going to process $file..." |
39 |
outputfile=$tempdir/`basename $file|sed s,'.psi$','.html,'` |
40 |
echo $libtool --mode=execute $psiconv $file -o $outputfile -Thtml |
41 |
$libtool --mode=execute $psiconv $file -o $outputfile -Thtml |
42 |
done |
43 |
|
44 |
echo "Going to produce the index..." |
45 |
( |
46 |
cd $tempdir |
47 |
files= |
48 |
for file in "$@"; do |
49 |
files="$files `basename $file|sed s,'.psi$','.html',`" |
50 |
done |
51 |
$mkindex $index $files |
52 |
) |
53 |
|
54 |
echo "Going to produce the final files..." |
55 |
for file in "$@"; do |
56 |
echo "Going to process $file..." |
57 |
inputfile=$tempdir/`basename $file|sed s,'.psi$','.html,'` |
58 |
outputfile=$outputdir/`basename $file|sed s,'.psi$','.html,'` |
59 |
rm -f $outputfile |
60 |
echo $mkdef $index $inputfile \> $outputfile |
61 |
$mkdef $index $inputfile > $outputfile |
62 |
done |