-
Notifications
You must be signed in to change notification settings - Fork 1
/
auto.sh
executable file
·52 lines (47 loc) · 3.19 KB
/
auto.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
BASEDIR=$(dirname $0)
rm -rf docbook
python $BASEDIR/im.py $BASEDIR/FileTranslations . docbook/
echo '=================================================='
cd docbook
find . -type f -print0 | xargs -0 sed -i 's/<br>$/\n/g'
find . -type f -print0 | xargs -0 sed -i 's/<\/br>$/\n/g'
find . -type f -print0 | xargs -0 sed -i 's/<br\/>$/\n/g'
find . -type f -print0 | xargs -0 sed -i 's/<\/li><br\/><li>/<\/li><li>/g'
find . -type f -print0 | xargs -0 sed -i 's/<\/li><\/br><li>/<\/li><li>/g'
find . -type f -print0 | xargs -0 sed -i 's/<br\/><br\/>/fanhang/g'
find . -type f -print0 | xargs -0 sed -i 's/<\/br><\/br>/fanhang/g'
find . -type f -print0 | xargs -0 sed -i 's/<\/br><br\/>/fanhang/g'
find . -type f -print0 | xargs -0 sed -i 's/<br\/><\/br>/fanhang/g'
find . -type f -print0 | xargs -0 sed -i 's/<br\/>/fanhang/g'
find . -type f -print0 | xargs -0 sed -i 's/<\/br>/fanhang/g'
find . -type f -print0 | xargs -0 sed -i 's/<ul>/youer/g'
find . -type f -print0 | xargs -0 sed -i 's/<\/ul>/splashyou/g'
find . -type f -print0 | xargs -0 sed -i 's/<ul\/>/splashyou/g'
find . -type f -print0 | xargs -0 sed -i 's/<li>/elouai/g'
find . -type f -print0 | xargs -0 sed -i 's/<\/li>/splashlee/g'
find . -type f -print0 | xargs -0 sed -i 's/<li\/>/splashlee/g'
find . -type f -print0 | xargs -0 sed -i '1N;$!N;s/\(!\[.*\](.*)\)[\n[ ]*]*\n[ ]*\*\*.*\*\*/\1/;P;D'
python $BASEDIR/con.py ./SUMMARY.md docbook
cd docbook
find . -type f -print0 | xargs -0 sed -i 's/sect1/section/g'
find . -type f -print0 | xargs -0 sed -i 's/sect2/section/g'
find . -type f -print0 | xargs -0 sed -i 's/informaltable/table/g'
find . -type f -print0 | xargs -0 sed -i '1N;$!N;s/<para>\n[ ]*<emphasis role="strong">介绍<\/emphasis>\n[ ]*<\/para>/<formalpara><title>介绍<\/title><para><\/para><\/formalpara>/;P;D'
find . -type f -print0 | xargs -0 sed -i '1N;$!N;s/<para>\n[ ]*<emphasis role="strong">概述<\/emphasis>\n[ ]*<\/para>/<formalpara><title>概述<\/title><para><\/para><\/formalpara>/;P;D'
find . -type f -print0 | xargs -0 sed -i '1N;$!N;s/<para>\n[ ]*<emphasis role="strong">结果<\/emphasis>\n[ ]*<\/para>/<formalpara><title>结果<\/title><para><\/para><\/formalpara>/;P;D'
find ./zh-CN -type f -execdir python $BASEDIR/xmlmod.py {} \;
find . -type f -print0 | xargs -0 sed -i 's/\(<imagedata fileref="\)\(.*png" \)\(\/>\)/\1\2format="PNG" scale="100" \3/'
find . -type f -print0 | xargs -0 sed -i 's/fanhang/<\/para><para>/g'
find . -type f -print0 | xargs -0 sed -i 's/<entry>/<entry><para>/g'
find . -type f -print0 | xargs -0 sed -i 's/<\/entry>/<\/para><\/entry>/g'
find . -type f -print0 | xargs -0 sed -i 's/youer/<itemizedlist>/g'
find . -type f -print0 | xargs -0 sed -i 's/splashyou/<\/itemizedlist>/g'
find . -type f -print0 | xargs -0 sed -i 's/elouai/<listitem><para>/g'
find . -type f -print0 | xargs -0 sed -i 's/splashlee/<\/para><\/listitem>/g'
find . -type f -print0 | xargs -0 sed -i 's/administrator-guide.ent/..\/administrator-guide.ent/g'
sed -i 's/..\/administrator-guide.ent/administrator-guide.ent/g' zh-CN/administrator-guide.xml
find . -type f -print0 | xargs -0 sed -i 's/<section id="/<section xmlns="http:\/\/docbook.org\/ns\/docbook" xml:id="/g'
cp -r ../../images/ ./zh-CN
cd zh-CN
cp $BASEDIR/pom.xml ./
mvn clean generate-sources -e