aboutsummaryrefslogtreecommitdiff
path: root/utility/katex/wrapper
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-05-27 21:34:37 +0200
committerAdrian Kummerlaender2018-05-27 21:34:37 +0200
commit8223f1abb07fd5c26c1361b42e9c7527fd718fa5 (patch)
treef353335761d63a8e04387f45eb681c4cc218bf04 /utility/katex/wrapper
parentc4106eec8119de1a77e1763897d991673d890805 (diff)
downloadblog.kummerlaender.eu-8223f1abb07fd5c26c1361b42e9c7527fd718fa5.tar
blog.kummerlaender.eu-8223f1abb07fd5c26c1361b42e9c7527fd718fa5.tar.gz
blog.kummerlaender.eu-8223f1abb07fd5c26c1361b42e9c7527fd718fa5.tar.bz2
blog.kummerlaender.eu-8223f1abb07fd5c26c1361b42e9c7527fd718fa5.tar.lz
blog.kummerlaender.eu-8223f1abb07fd5c26c1361b42e9c7527fd718fa5.tar.xz
blog.kummerlaender.eu-8223f1abb07fd5c26c1361b42e9c7527fd718fa5.tar.zst
blog.kummerlaender.eu-8223f1abb07fd5c26c1361b42e9c7527fd718fa5.zip
Add Nix derivation, dependencies
Diffstat (limited to 'utility/katex/wrapper')
-rwxr-xr-xutility/katex/wrapper16
1 files changed, 16 insertions, 0 deletions
diff --git a/utility/katex/wrapper b/utility/katex/wrapper
new file mode 100755
index 0000000..24a91d1
--- /dev/null
+++ b/utility/katex/wrapper
@@ -0,0 +1,16 @@
+#!/usr/bin/env node
+
+var katex = require("./katex.min.js");
+var input = "";
+
+var args = process.argv.slice(2);
+
+process.stdin.on("data", function(chunk) {
+ input += chunk.toString();
+});
+
+process.stdin.on("end", function() {
+ var options = { displayMode: args.indexOf("--display-mode") !== -1 };
+ var output = katex.renderToString(input, options);
+ console.log(output);
+});