-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
executable file
·25 lines (20 loc) · 963 Bytes
/
make.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
#!/bin/sh
pandoc -s -t html5 tutorial.tex > index.html
sed -i '/<style.*>/,/<\/style>/d' index.html
sed -i 's|</head>|</head><style>\n</style>|' index.html
sed -i -e '/<style>/r main.css' index.html
sed -i 's|</body>|<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang=hs"></script>\n</body>|' index.html
sed -i 's|<pre class="sourceCode haskell">|<pre class="sourceCode haskell prettyprint">|' index.html
sed -i 's|<code>|<code class="verbated">|g' index.html
INNAV=""
for title in $(grep "<h1 id" index.html | sed -e 's/.*id=\"\(.*\)\".*/\1/')
do
act=$(echo "$title" | sed "s/-/ /g" |sed 's/.*/\u&/')
INNAV="$INNAV\n<li><a href=\"#$title\">$act</a></li>"
done
sed -i "s|</header>|</header>\n<nav>\n<ol>$INNAV\n</ol></nav>|" index.html
LST="figspng/connect.png figspng/overlay.png figspng/fmap.png figspng/saturate.png"
for f in $LST
do
sed -i "s|<img src=\"$f\"|<img src=\"$f\" class=\"big\"|" index.html
done