summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2020-02-17 22:24:24 +0100
committerThomas Letan <lthms@soap.coffee>2020-02-17 22:24:24 +0100
commit44fc8666ff95de96229e45ae252519d9ad6fe8d5 (patch)
tree30c46a4166c7359e34b2d2614727a34a022e8ec4 /scripts
parentRemove ugly border around my avatar (diff)
Render inline math at build time using KaTeX
Diffstat (limited to 'scripts')
-rw-r--r--scripts/katex.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/katex.js b/scripts/katex.js
new file mode 100644
index 0000000..b3f6925
--- /dev/null
+++ b/scripts/katex.js
@@ -0,0 +1,10 @@
+/* Render inline maths using KaTeX */
+var katex = require("katex");
+var fs = require("fs");
+var input = fs.readFileSync(0);
+
+var html = katex.renderToString(String.raw`${input}`, {
+ throwOnError: false
+});
+
+console.log(html)