-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtoweb
executable file
·104 lines (89 loc) · 2.88 KB
/
toweb
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
#!/bin/bash
WEBDIR=$HOME"/MyWWWHome/web/~Frank.Luebeck/gap/GAPDoc/"
echo "Is ./index.html updated (Version, subdir, archive names, last updated)?"
echo "Copying files to this web directory, is that ok?"
echo " "$WEBDIR
echo "Assuming that in this directory exist archives "
echo " "GAPDoc-`cat version`"{.tar.bz2,,tar.gz,-win.zip}"
echo "Shall I start (y/N)?"
read -n 1 -p "-->" start
echo
if [ $start'X' != 'yX' ]; then
echo Ok, please adjust and try again.
exit 2
fi
mkdir -p $WEBDIR
echo making nocolor ps-versions of manual and example and HTML with external
echo links to www.gap-system.org . . .
cd doc
./clean
cd ../example
./clean
cd ..
rm -f tttttmppre
echo 'SetGapDocLaTeXOptions("nocolor");pathtoroot:="https://www.gap-system.org/Manuals";' > tttttmppre
grep -v SetGapDocLaTeXOptions makedocrel.g >> tttttmppre
../../gap < tttttmppre > /dev/null
../../gap < tttttmppre > /dev/null
rm -f tttttmppre
pdftops doc/manual.pdf doc/manual.ps
pdftops example/manual.pdf example/manual.ps
echo making text versions of manual and example for web page . . .
rm -f gapdoc.txt example.txt example-nc.txt gapdoc-nc.txt
cat doc/chap{0,1,2,3,4,5,6,7,A,B,C,Bib,Ind}.txt > gapdoc.txt
cat example/chap{0,1,2,A,B,Bib,Ind}.txt > example.txt
../../gap >/dev/null <<EOF
SetGAPDocTextTheme();
s:=StringFile("gapdoc.txt");
FileString("gapdoc-nc.txt", StripEscapeSequences(s));
FileString("gapdoc.txt", SubstituteEscapeSequences(s, GAPDocTextTheme));
s:=StringFile("example.txt");
FileString("example-nc.txt", StripEscapeSequences(s));
FileString("example.txt", SubstituteEscapeSequences(s, GAPDocTextTheme));
quit;
EOF
echo copying documentation to web page . . .
cp gapdoc.txt example.txt example-nc.txt gapdoc-nc.txt $WEBDIR
HERE=`pwd`
cd $WEBDIR
mkdir -p doc
mkdir -p example
mkdir ttttmpdir
cd ttttmpdir
tar xjf $HERE/GAPDoc-`cat $HERE/version`.tar.bz2
cd *
mv CHANGES ../../CHANGES.txt
mv README.md ../../README.txt
mv PackageInfo.g ../../
mv doc/* ../../doc
mv example/* ../../example
cd ../..
rm -rf ttttmpdir
cd $HERE
cp doc/manual.ps doc/chap*.html $WEBDIR/doc/
cp example/manual.ps example/chap*.html $WEBDIR/example/
echo copying index.html and pkgreadme.css . . .
cp index.html pkgreadme.css $WEBDIR
echo copying archives . . .
cp GAPDoc-`cat version`{.tar.bz2,.tar.gz,-win.zip} $WEBDIR
echo "creating SERVE files (maybe restart server)"
cd $WEBDIR
rm -f SERVE
ls *.html > SERVE.tmp
sed -e 's/$/:text\/html;charset=utf-8/' SERVE.tmp > SERVE
rm SERVE.tmp
echo "gapdoc.txt:text/plain;charset=utf-8" >> SERVE
echo "gapdoc-nc.txt:text/plain;charset=utf-8" >> SERVE
echo "example.txt:text/plain;charset=utf-8" >> SERVE
echo "example-nc.txt:text/plain;charset=utf-8" >> SERVE
cd doc
rm -f SERVE
ls *.html > SERVE.tmp
sed -e 's/$/:text\/html;charset=utf-8/' SERVE.tmp > SERVE
rm SERVE.tmp
cd ../example
rm -f SERVE
ls *.html > SERVE.tmp
sed -e 's/$/:text\/html;charset=utf-8/' SERVE.tmp > SERVE
rm SERVE.tmp
cd $HERE