-
Notifications
You must be signed in to change notification settings - Fork 4
/
update-mathjax
executable file
·64 lines (54 loc) · 1.65 KB
/
update-mathjax
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
58
59
60
61
62
63
64
#! /usr/bin/env sh
MJX_HOME=${MJX_HOME:-~/MathJax}
MJX_DEV_HOME=${MJX_DEV_HOME:-~/MathJax-dev}
DEST=$PWD/mw2slob/MathJax
TYPE=${OUTPUT_TYPE:-"SVG"}
echo "MathJax home: $MJX_HOME"
echo "MathJax-dev home: $MJX_DEV_HOME"
echo "Destination: $DEST"
echo "Output type: $TYPE"
cd $PWD/mathjax/
cp MediaWiki_${TYPE}.lis $MJX_DEV_HOME/combiner/lists/
cp config/MediaWiki_${TYPE}_settings.js $MJX_HOME/config/
cp extensions/texvc.js $MJX_HOME/extensions/TeX/
cp extensions/wiki2jax.js $MJX_HOME/extensions/
rm $MJX_HOME/config/MediaWiki_${TYPE}.js
$MJX_DEV_HOME/combiner/combineMJ $MJX_HOME
mkdir -p $DEST/jax/output
mkdir -p $DEST/extensions/TeX
cd $MJX_HOME
SYNC="rsync -aP"
$SYNC MathJax.js $DEST
cp config/MediaWiki_${TYPE}.js $DEST/MediaWiki.js
sed -i "s/\[MathJax\]\/config\/MediaWiki_${TYPE}\.js/\[MathJax\]\/MediaWiki\.js/g" $DEST/MediaWiki.js
#enabling CommonHTML preview incurs
#prohibiting penalty on mobile, at least in MathJax 2.5
#$SYNC jax/output/CommonHTML $DEST/jax/output/
$SYNC jax/output/${TYPE} \
--exclude imageFonts.js \
--exclude config.js \
--exclude jax.js \
--exclude mtable.js \
--exclude Asana-Math \
--exclude Gyre-Termes \
--exclude Neo-Euler \
--exclude Gyre-Pagella \
--exclude Latin-Modern \
--exclude TeX \
$DEST/jax/output/
$SYNC extensions/TeX \
--exclude noErrors.js \
--exclude noUndefined.js \
--exclude AMSmath.js \
--exclude AMSsymbols.js \
--exclude mathchoice.js \
--exclude texvc.js \
--exclude color.js \
--exclude cancel.js \
--exclude mediawiki-texvc.js \
$DEST/extensions/
if [ -d fonts/${TYPE}/STIX-Web/woff ]; then
mkdir -p $DEST/fonts/${TYPE}/STIX-Web/
$SYNC fonts/${TYPE}/STIX-Web/woff $DEST/fonts/${TYPE}/STIX-Web/
fi
du -hs $DEST