-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcmd.sh
More file actions
57 lines (52 loc) · 1.07 KB
/
Copy pathcmd.sh
File metadata and controls
57 lines (52 loc) · 1.07 KB
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
setup() {
printer "🔨 Setting up the repo"
git submodule update --init --recursive
handler
}
notes() {
printer "📚 Generating notes"
mkdir -p dist
FILES=()
while IFS= read -r f; do
FILES+=("$f")
done < <(printf "%s\n" md/*.md | sort -V)
pandoc "${FILES[@]}" \
-o dist/content.pdf \
--metadata-file=md/__metadata__.yml \
--from=markdown \
--template=pandoc-latex-template/template-multi-file/eisvogel.latex \
--pdf-engine=xelatex \
--filter=pandoc-latex-environment \
--listings
pdfunite \
dist/front.pdf \
dist/content.pdf \
dist/Notes.pdf
open dist/
handler
}
printer() {
echo ""
echo $1
echo ""
}
handler() {
if [ $? -eq 0 ]; then
printer "✅ Process completed successfully"
else
printer "❌ An error occurred during the process"
exit 1
fi
}
case $1 in
setup)
setup
;;
notes)
notes
;;
*)
echo "Usage: $0 {setup|notes}"
;;
esac