-
Notifications
You must be signed in to change notification settings - Fork 2
/
.htgetDeps.sh
50 lines (40 loc) · 1.62 KB
/
.htgetDeps.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
48
49
50
#!/bin/bash
echo ======== Ensuring www-data write access to directories ========
chmod 777 log cache && echo 'Succcess!' || echo 'Failure! Results not recorded until fixed'
echo ======== Getting Michelf\'s Markdown processor ========
wget -nc "https://raw.githubusercontent.com/michelf/php-markdown/lib/Michelf/Markdown.php" -P Michelf
wget -nc "https://raw.githubusercontent.com/michelf/php-markdown/lib/Michelf/MarkdownExtra.php" -P Michelf
wget -nc "https://raw.githubusercontent.com/michelf/php-markdown/lib/Michelf/MarkdownInterface.php" -P Michelf
if grep 'server-side' course.json | grep -q true
then
echo ======== Getting server-side KaTeX ========
sudo npm install --global katex
echo
if [ ! -d katex ]
then
mkdir katex
cp /usr/local/lib/node_modules/katex/dist/katex.min.css katex/ \
|| cp /usr/lib/node_modules/katex/dist/katex.min.css katex/
cp -r /usr/local/lib/node_modeuls/katex/dist/fonts katex/ \
|| cp -r /usr/lib/node_modeuls/katex/dist/fonts katex/
else
echo 'KaTeX fonts and CSS already there; not retrieving.'
echo
fi
else
echo ======== Getting client-side KaTeX ========
if [ ! -e .htKaTeX.json ]
then
wget https://api.github.com/repos/KaTeX/KaTeX/releases/latest -O .htKaTeX.json
url=$(cat .htKaTeX.json | egrep -o '"browser_download_url" *: *"[^"]*"' | cut -d'"' -f4 | grep '.tar')
wget -nc $url
[ -d katex ] && rm -rf katex
tar xvf katex.tar*
rm katex.tar*
echo
else
echo 'Client-side KaTeX already there; not retrieving.'
echo
fi
fi
exit