-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmarkdown
More file actions
executable file
·42 lines (40 loc) · 1.31 KB
/
Copy pathmarkdown
File metadata and controls
executable file
·42 lines (40 loc) · 1.31 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
#!/bin/bash
if `test -n "$1" && test -f $1`; then
fname=`echo $1 | sed -r "s/\.[^.]*$//"`.html
echo "<div><div class='wrapper'>"
cat $1 | markdown_py -x mathjax
echo "</div><div class='pos'></div>"
echo "<script src='mathjax/unpacked/MathJax.js?config=default'></script>
<script type=\"text/x-mathjax-config\">
MathJax.Hub.Register.StartupHook(\"TeX Jax Ready\",function () {
var TEX = MathJax.InputJax.TeX;
var PREFILTER = TEX.prefilterMath;
TEX.Augment({
prefilterMath: function (math,displaymode,script) {
math = \"\\\\displaystyle{\"+math+\"}\";
return PREFILTER.call(TEX,math,displaymode,script);
}
});
});
var a = document.getElementsByTagName('a'),
ll = a.length;
if (ll > 0) {
var div = document.getElementsByClassName('pos')[0];
div.style.float = 'right';
div.style.position = 'fixed';
div.style.background = '#FFF';
div.style.fontSize = '90%';
div.style.top = '10%';
div.style.right = '5%';
div.style.width = '15%';
for (var i = 0; i < ll; i++) {
div.innerHTML += '<a href=\"\#' + a[i].name + '\">'
+ a[i].parentElement.nextElementSibling
.nextElementSibling.innerHTML
+ '</a><br />';
}
var div = document.getElementsByClassName('wrapper')[0];
div.style.width = '80%';
}
</script></div>"
fi