writefreely/templates/include/render.tmpl

34 lines
1.1 KiB
Cheetah
Raw Normal View History

<!-- 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}}