-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·36 lines (30 loc) · 980 Bytes
/
setup.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
#!/bin/bash
set -ex
git submodule update --init
cd ./scala_text
../sbt mdoc
cd ..
cp ./scala_text/book.json ./
cp -r ./scala_text/src/img ./
cp -r ./scala_text/src/example_projects ./
for f in ./img/*.svg
do
if [[ $f =~ \./img/(.*)\.svg ]]; then
SVG=`pwd`/img/${BASH_REMATCH[1]}.svg
PDF=`pwd`/${BASH_REMATCH[1]}.pdf
PDFTEX=`pwd`/${BASH_REMATCH[1]}.pdf_tex
inkscape -D "$SVG" --export-filename="$PDF" --export-latex
python3 ./python/fix_pdf_tex.py "$PDF" < "$PDFTEX" > "$PDFTEX.tmp"
mv "$PDFTEX.tmp" "$PDFTEX"
fi
done
if [[ ! -d "./target" ]]; then
mkdir target
fi
for f in ./scala_text/honkit/*.md
do
if [[ $f =~ \./scala_text/honkit/(.*)\.md ]]; then
cp $f ./target/
FILENAME="${BASH_REMATCH[1]}.md" pandoc -o "./target/${BASH_REMATCH[1]}.tex" -f markdown_github+footnotes+header_attributes-hard_line_breaks-intraword_underscores --pdf-engine=lualatex --top-level-division=chapter --listings --filter ./python/filter.py $f
fi
done