aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/warpc/katex.go
blob: 0a85d94b6a84d5ee191e14755c9a34dcd359bebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package warpc

import (
	_ "embed"
)

//go:embed wasm/renderkatex.wasm
var katexWasm []byte

// See https://katex.org/docs/options.html
type KatexInput struct {
	Expression string       `json:"expression"`
	Options    KatexOptions `json:"options"`
}

type KatexOptions struct {
	Output       string `json:"output"` // html, mathml (default), htmlAndMathml
	DisplayMode  bool   `json:"displayMode"`
	ThrowOnError bool   `json:"throwOnError"`
}

type KatexOutput struct {
	Output string `json:"output"`
}