You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
397 B
13 lines
397 B
2 years ago
|
import socket
|
||
|
import subprocess
|
||
|
import tempfile
|
||
|
|
||
|
|
||
|
class KatexClient:
|
||
|
def __init__(self):
|
||
|
self._client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||
|
self._temp_dir = tempfile.TemporaryDirectory(prefix='formatitko')
|
||
|
socket_file = self._temp_dir.name + "/katex-socket"
|
||
|
self._client.bind(socket_file)
|
||
|
self._server = subprocess.Popen(["node", "./katex-server/index.mjs", socket_file])
|