KaTeX: drop js script files, use build-time rendering instead
This PR fixes #2270.
With > 300 lines dropped (user guide + scripts), this PR significantly simplifies the documentation and the code base for KaTeX handling. This PR brings several advantages to the user:
- faster page loading times through build time rendering
- Autoactivation works in all cases now, also with inline formulae. Activation and configuration were dropped completely from the configuration file, everything is done behind the scenes now.
mhchemextension is included in Hugo's embedded KaTeX engine as of v.0.144.0. No need for activation or configuration ofmhchemextension inside the config file any more.
Preview: https://deploy-preview-2276--docsydocs.netlify.app/docs/adding-content/diagrams-and-formulae/
Great news about the simplification! Thanks.
You are welcome!
Could you update the PR (including the title) to say that this is build-time rendering, not server-side.
Done.
In terms of code style for this repo, please favor tail-end whitespace globing using
-}}and drop the{{-when it is unnecessary -- which is most of the time. Thanks.
Changed as requested.
I'll take a closer review as soon as I can.
Looking forward receiving your review soon!
Thanks for your thorough review, all changes are incorporated, checkers are green. While working on the review, I realized that the KaTex stylesheet helds several references to KateX font files. Since we are storing the stylesheet locally now, all these links were broken. This is corrected with this PR now, I'm downloading not only the css file but also the font files at build time now. I realized that this defect is present in recently released version 12.0 too. I think this defect should be fixed there. We can either backport my changes into v12.0 or we make a new release v12.1 which helds my solution submitted with this PR. Sorry for the inconvenience. @chalin: WDYT?
Thanks for your thorough review, all changes are incorporated, checkers are green.
Great!
Will get back to you as soon as I can for the next round of review.
Marvelous
We can either backport my changes into v12.0 or we make a new release v12.1
We'll be putting out a new release (0.13.0) soon.