-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·47 lines (42 loc) · 1.36 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
44
45
46
47
#!/bin/sh
CONTENTDIR="content"
BUILDDIR="build"
FILENAME="index"
ASSETSDIR="assets"
download_csl() {
mkdir "${ASSETSDIR}" -p
wget -O "${ASSETSDIR}/citation-style.csl" \
"https://raw.githubusercontent.com/citation-style-language/styles/master/harvard-anglia-ruskin-university.csl"
}
pdf_print() {
mkdir "${BUILDDIR}" -p
echo "Creating PDF print output"
pandoc "${CONTENTDIR}/${FILENAME}.md" \
--resource-path="${CONTENTDIR}" \
--citeproc \
--csl="${ASSETSDIR}/citation-style.csl" \
--from="markdown+tex_math_single_backslash+tex_math_dollars+raw_tex" \
--to="latex" \
--output="${BUILDDIR}/output_print.pdf" \
--pdf-engine="xelatex" \
--include-in-header="layouts/print.tex"
}
pdf_ereader() {
mkdir "${BUILDDIR}" -p
echo "Creating PDF ereader output"
pandoc "${CONTENTDIR}/${FILENAME}.md" \
--resource-path="${CONTENTDIR}" \
--citeproc \
--csl="${ASSETSDIR}/citation-style.csl" \
--from="markdown+tex_math_single_backslash+tex_math_dollars+raw_tex" \
--to="latex" \
--output="${BUILDDIR}/output_ereader.pdf" \
--pdf-engine="xelatex" \
--include-in-header="layouts/ereader.tex"
}
clean() {
rm -r "${BUILDDIR}"
}
# Allows to call a function based on arguments passed to the script
# Example: `./build.sh pdf_print`
$*