-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·45 lines (33 loc) · 1.28 KB
/
build.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
#!/usr/bin/env bash
cd /data/
if [ ! -d "mkdocs-combine" ] ; then
git clone https://github.com/ebadi/mkdocs-combine.git
fi
if [ ! -d "pandoc-book-template" ] ; then
git clone https://github.com/ebadi/pandoc-book-template.git
fi
if [ ! -d $1 ] ; then
echo "First argument, documentation folder is not found in the current directory"
fi
rm -rf /data/mkdocs-combine/mkdocs_combine.egg-info
pip3 install -e /data/mkdocs-combine
cd /data/$1
mkdocs build
mkdocscombine --admonitions-md -o /data/$1.pd
sed -i 's/---//g' /data/$1.pd
sed '/TOREMOVE/d' -i /data/$1.pd
sed 's/✅/Yes/' -i /data/$1.pd
sed 's/❌/No/' -i /data/$1.pd
sed '/<div class="build-buttons">/,/<\/div>/d' -i /data/$1.pd
sed '/<button/d' -i /data/$1.pd
pandoc --number-sections --toc -f markdown+grid_tables+table_captions -o /data/$1.pdf /data/$1.pd --pdf-engine=xelatex \
--listings -H /data/listings-setup.tex \
--template=/data/pandoc-book-template/templates/pdf.latex \
--toc-depth=2 \
-V papersize=a4 \
-V geometry:"top=2cm, bottom=2cm, left=1.5cm, right=1.5cm" \
-V documentclass="article" \
-V fontsize=12 \
-V toc-depth=2
#documentclass="book"
pandoc --toc -f markdown+grid_tables --template /data/pandoc-book-template/templates/epub.html -t epub -o /data/$1.epub /data/$1.pd