Newer
Older
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
#!/bin/bash
# processing command line arguments
# Define variables
MATHJAX_URL='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
# Check commandline arguments
if [ $# -lt 1 ]
then
RESEARCH_BUILD=`pwd`"/build"
RESEARCH_TOPICS=`pwd`
echo -e "No building directory was specified."
elif [ $# -lt 2 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS=$RESEARCH_BUILD
echo -e "No extra topics directory was specified."
else
RESEARCH_BUILD="$1"
RESEARCH_TOPICS="$2"
fi
mkdir -p $RESEARCH_BUILD
echo -e "Building into directory $RESEARCH_BUILD ..."
echo -e "Using .md-files from $RESEARCH_TOPICS ..."
# specify URL to avoid use of local library
# see https://docs.mathjax.org/en/latest/web/start.html#ways-of-accessing-mathjax
# and https://www.jsdelivr.com/package/npm/mathjax
# create plain _research.html to be integrated into other files
for f in $RESEARCH_TOPICS/*.md
do
filename=$(basename -- "$f")
echo "Creating " $RESEARCH_BUILD/"${filename%.md}"_research.html " ..."
pandoc $f -o $RESEARCH_BUILD/"${filename%.md}"_research.html \
--mathjax=$MATHJAX_URL \
-c css/base.css \
-c css/extra.css \
-c "css/print.css" \
-c "css/superfish.css" \
-c "css/superfish-vertical.css" \
-c "css/base_mode.css"
done