Closed fwcd closed 3 months ago
The formatting looks broken:
Oh that's interesting, locally the math rendered fine for me:
Is this something that has to be configured for the deployment?
My screenshot is from the Netlify Preview.
Looks like something's wrong with the way MathJax is loaded:
I found a forum post that discusses this and we might be able to get this to work by updating the content security policy to allow loading the MathJax script:
https://answers.netlify.com/t/enabling-mathjax-without-using-cms/6873/4
We ran into this now because the Mixxx manual didn't seem to use any math yet, but if we need to add a formula somewhere in the future this would probably be useful to have anyway.
I agree. We should also look to whether its feasible to render the formula to SVG at build-time rather than relying on client-side JS to do it since it results in a suboptimal user experience (slower loadtime, likely shifting page content as placeholders get expanded to their content, etc).
Maybe it's only an issue of the Netlify Preview?
We should also look to whether its feasible to render the formula to SVG at build-time rather than relying on client-side JS to do it since it results in a suboptimal user experience
MathJax is pretty standard across the ecosystem and from what I understand client-side rendering is a bit better for accessibility, but you're right that things shifting around is generally less nice. Maybe MathML would be an option too, but I'm not sure if Sphinx supports that.
I think configuring the Netlify CSP to support MathJax should be pretty easy, therefore I would lean towards doing that for now and moving SVG prerendering etc. into a separate PR.
Okay, so enabling SVG rendering was actually a lot easier than I thought, configuring Sphinx to use sphinx.ext.imgmath
with SVG was enough 😄 Though I am still a bit torn. SVG rendering might be the easiest, least-invasive option for now, but I still think we should explore MathJax/MathML rendering in the future.
Advantages of SVG rendering:
Disadvantages:
Hm, for some reason this still doesn't work in the deploy preview, though the CSP error seems to be unrelated:
I suspect the issue is that Netlify's build environment is somehow missing dvisvgm
(the LaTeX renderer)... maybe MathJax is the way to go after all.
After updating the Content-Security-Policy to allow MathJax, the math now renders properly on Netlify. This uses the default client-side MathJax renderer for now, we can discuss using alternative renderers in future PRs including potential tradeoffs, this seems to be too large to tackle here.
I have also squashed/cleaned up my commits, so the PR should be ready for another review.
LGTM! Thank you!
This is a sibling PR to https://github.com/mixxxdj/mixxx/pull/4684 that documents the new mapping settings, specifically jogwheel acceleration.