mirror of
https://github.com/writefreely/writefreely
synced 2025-01-25 13:45:02 +00:00
a659acdc14
Might as well do this right away, we're here anyway.
33 lines
1.1 KiB
Cheetah
33 lines
1.1 KiB
Cheetah
<!-- Miscelaneous render related template parts we use multiple times -->
|
|
{{define "highlighting"}}
|
|
<!-- TODO: make this conditional on presence of code blocks -->
|
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/atom-one-light.min.css"/>
|
|
<script type="text/javascript"
|
|
src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js" async></script>
|
|
|
|
<script>
|
|
addEventListener('load', function () {
|
|
var x = document.querySelectorAll("code[class^='language-']");
|
|
for (i=0; i<x.length; i++) {
|
|
hljs.highlightBlock(x[i]);
|
|
}});
|
|
</script>
|
|
{{end}}
|
|
|
|
<!-- Include mathjax configuration -->
|
|
{{define "mathjax"}}
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
extensions: ["tex2jax.js"],
|
|
jax: ["input/TeX", "output/HTML-CSS"],
|
|
tex2jax: {
|
|
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
|
|
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
|
|
processEscapes: true
|
|
},
|
|
"HTML-CSS": { fonts: ["TeX"] }
|
|
});
|
|
</script>
|
|
<script type="text/javascript"
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML" async></script>
|
|
{{end}}
|