-
Notifications
You must be signed in to change notification settings - Fork 2
/
update.sh
29 lines (28 loc) · 962 Bytes
/
update.sh
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
#!/bin/bash
for j in man odt
do
rm -rf $j
mkdir -p $j
for i in $(ls rst/*.rst | sed "s/.rst$//g" | sed "s/rst\///g" | sort)
do
rst2$j rst/$i.rst > $j/$i.$j
done
done
rm -rf html
mkdir -p html
for i in $(ls rst/*.rst | sed "s/.rst$//g" | sed "s/rst\///g" | sort)
do
rst2html --link-stylesheet rst/$i.rst > html/$i.html
done
sed -i 's|href=.*.css|href=\"main.css|g' html/*.html
sed -i '9d;8a<meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; maximum-scale=1.0;\">' html/*.html
cat main.css > html/main.css
echo "<head><title>Sayfalar</title>" > index.html
echo "<meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; maximum-scale=1.0;\">" >> index.html
echo '<link rel="stylesheet" href="main.css" />' >> index.html
echo "</head><body>" >> index.html
for i in $(ls html | grep ".html$" | sed "s/.html//g" | sort)
do
echo -e "=> <a href=\"html/$i.html\">$i</a><br>" >> index.html
done
echo "</body>" >> index.html