-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
transform.ToMath, WASI/Wasm modules feedback thread #12736
Comments
While very useful on its own (and combined with the passthrough render hooks), this is 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 change 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: * 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: * 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: * 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: * 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: * 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: * 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: * 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: * #12736 * #12737 See #11927
Hi, thanks for adding this feature, it was quite straightforward to use it to switch to server-side math rendering in my theme. Edit: the issue reported below was my mistake, I was calling the shortcode with I made a math shortcode to let users call layouts/shortcodes/math.html
I noticed that if I don't chomp whitespace before the call to Perhaps |
I'm trying to use transform.ToMath with I'm using the hugo-book theme and it's very possible it's somehow related to that, but I'm hitting errors that look like "executing "book-section-children" at <.Content>: error calling Content:" – if I comment out the place that happens it just happens somewhere else, any place where .Content is being called. As far as I can tell I set things up correctly –
render-passthrough.html:
Am I missing something that should be obvious? I'm still relatively new to hugo, but I was really hoping to get server side rendering of the katex for this site :-/ $ hugo version
hugo v0.133.1+extended darwin/arm64 BuildDate=2024-08-26T13:58:46Z VendorInfo=brew |
I was able to get it working by using this instead:
|
@taxilian Please post the markdown you used for testing. I suspect you have double-escaped something, but we shouldn't be throwing an error. For example, with this markdown (note the erroneous double escape):
Hugo throws this error:
|
I hadn't considered that it could be related to the latex itself, given that it works when using katex on the client side, in a github gist, and with my weird changes above. With that information I was able to track it down to this line:
I missed that when fixing some markdown which came from chatgpt; it works if I change it to:
I'm not sure what kind of bug to call this – it seems like if it fails to render then there should at least be a more useful error message? |
OK, I didn't get get as much relevant feedback on this as I had hoped. I was hoping that adding this WASM/Wasi/JS feature could be a good proof of concept for further work in this area ... Putting those on ice for now. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Also see #12737.
transform.ToMath
uses Katex to render. Katex is a JS library.Wazero's compiler is configured for:
If not in the list above, Wazero will fall back to an interpreter, which works on all platforms, but is much slower.
The goal of this "thread" is to collect feedback, as in: "it works on Solaris, but is very slow ..."
It is technically possible for Hugo to enable the compiler for other OSes, but we're currently limited by the test setup.
Also, the hours invested in setting this up just for KaTeX doesn't make much sense. This was a proof of concept. For further ideas of where this takes us, see #2737.
The text was updated successfully, but these errors were encountered: