-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathconvert-to-mbx.sh
More file actions
executable file
·129 lines (108 loc) · 2.74 KB
/
Copy pathconvert-to-mbx.sh
File metadata and controls
executable file
·129 lines (108 loc) · 2.74 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/zsh
echo Conversion to HTML through PreTeXt. It is still beta quality and work in
echo progress. The realanal-html.xsl assumes a fixed location for the PreTeXt
echo xsl file. You need to edit this first.
echo Do ^C to get out.
echo
echo You should first run with --runpdft or --full to run the pdft figures.
echo
echo To rerun all figures first do \"rm "*-mbx.*" "*-mbxpdft.*"\", or run
echo this script with --kill-generated.
echo
PDFT=no
# parse parameters
while [ "$1" != "" ]; do
case $1 in
-h | --help)
exit
;;
--runpdft)
echo "OPTION (runpdft) Will run pdf_t figures"
PDFT=yes
;;
--full)
echo "OPTION (full) Will run pdf_t optimize svgs"
PDFT=yes
;;
--kill-generated)
echo "OPTION (kill-generated) Killing generated figures and exiting (not killing -mbx.svg)."
cd figures
rm *-mbx.(svg|png)
rm *-mbxpdft.(svg|png)
cd ..
exit
;;
*)
echo "ERROR: unknown parameter \"$1\""
exit 1
;;
esac
shift
done
# wait for enter or ^C
echo "[Press Enter to run on Ctrl-C to bail out]"
read
if [ "$PDFT" = "yes" ] ; then
echo
echo RUNNING FIGURES...
echo
cd figures
./figurerun.sh 192
cd ..
fi
echo
echo RUNNING convert-to-mbx.pl ...
echo
perl convert-to-mbx.pl
echo
echo REMOVE doubled horizontal rules
echo
perl -0777 -i -pe 's:<rahr/>[ \r\n]*<rahr/>:<rahr/>:igs' ./realanal-out.xml
#xmllint --format -o realanal-out2.xml realanal-out.xml
echo
echo MOVING OLD html, CREATING NEW html, COPYING figures/ in there
echo
if [ -e html ] ; then
mv html html.$RANDOM$RANDOM$RANDOM
fi
mkdir html
cd html
cp -a ../figures .
rm figures/.gitignore
rm figures/*.sh
rm figures/figurerun*
rm figures/*.fig
rm figures/*.pdf
rm figures/*.pdf_t
cp ../extra.css .
cp ../logo.png .
echo
echo RUNNING xsltproc
echo
xsltproc -stringparam publisher realanal-publisher.xml ../realanal-html.xsl ../realanal-out.xml
echo
echo Copy the _static things
echo
mkdir _static
mkdir _static/pretext
cp -a ~/pretext/js _static/pretext/
cp -a ~/pretext/css _static/pretext/
# this changes the background color to darker one
cat _static/pretext/css/dist/theme-default-modern.css | sed 's/23241f/121212/' > _static/pretext/css/theme.css
#cp _static/pretext/css/dist/theme-default-modern.css.map _static/pretext/css/
cp -a ~/pretext/js_lib _static/pretext/js/lib
echo
echo FIXING UP HTML ...
echo
for n in *.html; do
#echo -n "[$n]"
../fixup-html-file.pl < $n > tmpout
mv tmpout $n
done
echo
echo DONE ...
echo
echo 'Perhaps now do (if you are me): cp -a html/* ~/gh/jirilebl.github.io/ra/html/'
echo 'then commit, then run the updghweb.sh script'
echo 'Make sure you have run the script with --full before ...'
echo