-
DescriptionHello, I am trying to use Quarto along with Hugo to get a site up and running. I have been hoping to eliminate need for JS to run on the website, so I have been wondering how it would be possible to replace |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
|
I am not sure to understand. KaTeX, MathJax are all JavaScript. |
Beta Was this translation helpful? Give feedback.
-
|
There are tools to run KaTeX locally for example. This R package does it https://docs.ropensci.org/katex/ So you could imagine using R in your .qmd document for example, and have inline math rendered through R inline or block function. There is a post processing function for the HTML produced by Pandoc, but not for a .md that you would use for HUGO. Though you could maybe build something in same idea to post process you .md document and render katex locally. This could maybe be done using Lua filter - See this discussion where some links could be adapted to work with Quarto and your use case When rendered locally, only a CSS will be needed, and no rendering in browser through JS. As you are mentioning Hugo, you could also look for server-side option for Hugo. Hope it helps give idea on what could be done. |
Beta Was this translation helpful? Give feedback.
-
|
Hello folks, It runs katex on terminal, runs the following js using node and uses its output to substitute inside markdown. I've worked this out, using genAI, and am using this roundabout workthrough to avoid quirkiness of windows cmd compared to that in linux terminal. It'll be useful for quarto-hugo workflow. The filter is called using this in the qmd yaml In summary the filestructure should look like this: |
Beta Was this translation helpful? Give feedback.
Hello folks,
So I figured out a method which is somewhat hacky but it works and I figured I might as well post about it.
My implementation: first of all there's a directory within which lua extension sits. I also installed Katex in this folder using
npm install katex --prefix ./my-lua-filterwhich I'll be using. The Lua script I'm using goes as: