-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerateHTML.sh
More file actions
35 lines (27 loc) · 890 Bytes
/
generateHTML.sh
File metadata and controls
35 lines (27 loc) · 890 Bytes
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
#!/bin/sh
mkdir -p html
pandoc --mathjax=https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML --filter pandoc-crossref -s --toc --chapters -c github-pandoc.css --default-image-extension=png -f latex -t html opencal-userguide.tex -o opencal-userguide_FULL.html
htmldoc -t htmlsep -v -d html opencal-userguide_FULL.html
mkdir -p html_sanitized
#fix utf8
HEADER=`cat header.html`
echo "HEADER $HEADER"
export HEAD=$HEADER
cd html/
for f in ./*.html;
do
echo "Processing $f file..";
python ../fix-htmldoc-utf8.py $f > ../html_sanitized/$f
#add custom header: style and math javascriptv
perl -0777 -i.original -pe 's/<STYLE.*<\/STYLE>/$ENV{HEAD}/migs' ../html_sanitized/$f
done
cd ../html_sanitized
#mv all images
IMGS=`find ../images/ -name "*.png"`
for i in $IMGS
do
cp $i .
done
cp ../github-pandoc.css .
rm -rf *.original
google-chrome toc.html