mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
33c0938cd5
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * https://github.com/gohugoio/hugo/issues/12736 * https://github.com/gohugoio/hugo/issues/12737 See #11927
24 lines
503 B
Go
24 lines
503 B
Go
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"`
|
|
}
|