-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add build time generated math using Katex embedded as WASI #12679
Conversation
0cab941
to
20dc0b4
Compare
We would need a fix for tetratelabs/wazero#2294 for this to go beyond a proof of concept, I think, but I'm working on it. |
OK, my upstream Wazero patch was just merged (!). I'm going to do finish the "render hook" part of this in #12717 first, and then return to this PR. |
7eef0f3
to
a986f73
Compare
transform.ToMath(opts any) Where 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"`
} There may be some more (https://katex.org/docs/options.html) useful end user option, but it's not obvious to me. Does the func signature above make sense, @jmooring ? |
c84cad2
to
7701939
Compare
I'm sure you have a good reason for the signature above, but I would have expected this instead:
where |
Only me being lazy, I guess. So, from an end users perspective I guess it makes sense to have them split, so options can be defined somewhere (e.g. in |
Also note that I have named it |
OK, I have pushed a verion of |
9c612a2
to
79cc5ff
Compare
b226863
to
940a838
Compare
20783a3
to
1fb91e0
Compare
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: * gohugoio#12736 * gohugoio#12737 See gohugoio#11927
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: