-
Notifications
You must be signed in to change notification settings - Fork 2
/
_compile.sh
executable file
·57 lines (47 loc) · 2.04 KB
/
_compile.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
53
54
55
56
57
#!/bin/bash
cd "$(dirname "$0")"
rm -r target
mkdir target
cp -r {statqya.adoc,ramka-eskd.fodt,slim,dict,_compile.sh,statqya.xsd,xml.xsd,test.rb,sidi-i-pishi-pravilqno.png} target
cd target
echo aspell
# tag::spell_asciidoctor[]
docker run --rm -v $(pwd):/documents/ curs/asciidoctor-od asciidoctor \
statqya.adoc -b spell -o statqya.spell -T slim/base -T slim/spell
cat statqya.spell | sed "s/-/ /g" | \
aspell --master=ru --personal=./dict list > misspelled-list
# end::spell_asciidoctor[]
echo break lines
docker run --rm -v $(pwd):/documents/ curs/asciidoctor-od asciidoctor statqya.adoc \
-b break-line -o statqya.break-line -T slim/base -T slim/break-line
echo docbook
# tag::docbook_asciidoctor[]
docker run --rm -v $(pwd):/documents/ curs/asciidoctor-od asciidoctor \
statqya.adoc -b docbook -v 2> asciidoctor_log
# end::docbook_asciidoctor[]
# echo odt_test
# docker run --rm -v $(pwd):/documents/ curs/asciidoctor-od a-od-pre -r asciidoctor-mathematical -r asciidoctor-diagram statqya.adoc -o pre.xml --trace
echo odt
docker run --rm -v $(pwd):/documents/ curs/asciidoctor-od a-od statqya.adoc odt ramka-eskd.fodt
echo docx
docker run --rm -v $(pwd):/documents/ curs/asciidoctor-od a-od statqya.adoc docx ramka-eskd.fodt
echo pdf
docker run --rm -v $(pwd):/documents/ curs/asciidoctor-od a-od statqya.adoc pdf ramka-eskd.fodt
echo html
docker run --rm -v $(pwd):/documents/ curs/asciidoctor-od asciidoctor \
statqya.adoc -o index.html
echo make md
docker run --rm -v $(pwd):/data/ pandoc/core -f docbook -t markdown -s statqya.xml -o statqya.md --wrap=none --atx-headers
# Makrdown and Markdown are different languages
sed -i 's/{[#][a-zа-я_]*}//g' statqya.md
sed -i 's/---/—/g' statqya.md
sed -i 's/^$/\<cut\/\>/g' statqya.md
sed -i 's/\[\(.*\)\]{\.no-spell}/\1/' statqya.md
echo testing
docker run --rm -v $(pwd):/documents/ curs/asciidoctor-od ruby test.rb | tee unit_test.log
mkdir out
cp {statqya.odt,statqya.pdf,statqya.docx,statqya.md,index.html} out
if grep -q "[1-9][0-9]* failures" unit_test.log; then
echo test.rb failed
exit 1
fi