Skip to content

Commit 73600d4

Browse files
committed
Refactoring gen and build scripts
1 parent e4945db commit 73600d4

4 files changed

Lines changed: 34 additions & 48 deletions

File tree

bin/build

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ IFS=$(echo -en "\n\b")
66
for input in $(find units -type f -not -name Overview.md -name '*.md')
77
do
88
echo -n "Generating '$input' ... "
9-
10-
case $(basename $input) in
11-
Slides.md)
12-
bin/genslide "$input" "${input%.md}.pdf" &> /dev/null
13-
;;
14-
*)
15-
bin/gendoc "$input" "${input%.md}.pdf"
16-
;;
17-
esac
9+
bin/gen "$input" "${input%.md}.pdf" &> /dev/null
1810
echo "done"
1911
done
2012

bin/gen

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
input="$1"
4+
output="$2"
5+
6+
if [ ! -f "$input" ]; then
7+
echo "error: <input> file not found ('$input')"
8+
exit 1
9+
elif [ -z "$output" ]; then
10+
echo "error: missing <output> argument"
11+
exit 1
12+
fi
13+
14+
case $(basename "$input") in
15+
Slides.md)
16+
marp "$input" \
17+
--allow-local-files \
18+
--theme assets/slide-styles.marp \
19+
--html true \
20+
--pdf true \
21+
--output "$output"
22+
;;
23+
24+
*)
25+
pandoc "$input" \
26+
--resource-path="$(dirname "$input")" \
27+
--from markdown-smart \
28+
--highlight-style=assets/document-theme.theme \
29+
-H assets/document-header.tex \
30+
-V linkcolor=Blue \
31+
-o "$output"
32+
;;
33+
esac

bin/gendoc

Lines changed: 0 additions & 20 deletions
This file was deleted.

bin/genslide

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)