Skip to content

Unit 11: math engine — drop MathJax, keep KaTeX (gated, with SRI)#13

Open
stradichenko wants to merge 1 commit intomainfrom
unit-11-math-engine-drop-mathjax-keep-katex
Open

Unit 11: math engine — drop MathJax, keep KaTeX (gated, with SRI)#13
stradichenko wants to merge 1 commit intomainfrom
unit-11-math-engine-drop-mathjax-keep-katex

Conversation

@stradichenko
Copy link
Copy Markdown
Owner

Summary

  • Delete layouts/partials/math.html (MathJax loader).
  • Remove the inline math-reprocess script from baseof.html (last artifact of the dual KaTeX+MathJax setup).
  • Add assets/js/katex-init.js: imports KaTeX modules, runs renderMathInElement on DOMContentLoaded, exposes window.reprocessMath for dynamic content.
  • In head.html (gated on .Params.math or site.Params.math), include KaTeX CSS + JS with SRI integrity.
  • Document the math: true page param in README.md.

Notes for reviewer

  • ⚠️ Conflicts with Unit 5 on baseof.html (Unit 5 still references partials/math.html) and with Unit 6 on head.html (KaTeX block).

Test plan

  • A math: true page renders LaTeX via KaTeX.
  • Non-math pages do not load KaTeX assets.
  • No MathJax <script> in build output (grep -r "mathjax" exampleSite/public returns empty).

Part of the PKB-theme modernization batch (15 units).

- Delete layouts/partials/math.html (MathJax loader).
- Remove the inline math-reprocess script from baseof.html (was the last
  artifact of the dual KaTeX+MathJax setup).
- Add assets/js/katex-init.js: imports KaTeX modules, runs
  renderMathInElement on DOMContentLoaded, exposes window.reprocessMath
  for dynamic content.
- In head.html (gated on .Params.math or site.Params.math), include
  KaTeX CSS + JS with SRI integrity.
- Document the math: true page param in README.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant