diff options
Diffstat (limited to 'js')
| -rw-r--r-- | js/colors.js | 2 | ||||
| -rw-r--r-- | js/katex-opts.js | 14 | ||||
| -rw-r--r-- | js/toggle.js | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/js/colors.js b/js/colors.js index 158ad52..2cc6a18 100644 --- a/js/colors.js +++ b/js/colors.js @@ -1,4 +1,4 @@ -// @license http://www.wtfpl.net/txt/copying/" WTFPL +// @license "http://www.wtfpl.net/txt/copying/" WTFPL if ( localStorage.getItem("color-mode") === "dark" || ( !localStorage.getItem("color-mode") && window.matchMedia('(prefers-color-scheme: dark)').matches ) diff --git a/js/katex-opts.js b/js/katex-opts.js new file mode 100644 index 0000000..4909687 --- /dev/null +++ b/js/katex-opts.js @@ -0,0 +1,14 @@ +// @license "http://www.wtfpl.net/txt/copying/" WTFPL + +document.addEventListener("DOMContentLoaded", function() { + renderMathInElement(document.body, { + delimiters: [ + { left: "$$", right: "$$", display: true }, + { left: "\\[", right: "\\]", display: true }, + { left: "$", right: "$", display: false }, + { left: "\\(", right: "\\)", display: false }, + ] + }); +}); + +// @license-end diff --git a/js/toggle.js b/js/toggle.js index 884e0bf..46e4b6a 100644 --- a/js/toggle.js +++ b/js/toggle.js @@ -1,4 +1,4 @@ -// @license http://www.wtfpl.net/txt/copying/" WTFPL +// @license "http://www.wtfpl.net/txt/copying/" WTFPL function toggle(divid) { var cont = document.getElementById(divid); |
