Please allow me to cite myself:

Also, you would like to write the formulas directly into the documentation file during editing and also keep them in the compiled files without any separate files — imagine a documentation page with many formulas where the formulas should be rendered fast, compare LaTeX + the KaTeX library which is really fast — BTW faster than the (much bigger) MathJax library. *KaTeX is also so small it can easily be embedded into every HTML output* (if LaTeX formulas are used).

Note that LaTeX formulas (if they are not too complicated) are also quite readable when you just look at their code, no need to add a separate description, just write them (with appropriate separators) into the documentation source “and you are done”. And in the case of looking at a produced HTML with an according library like KaTeX missing, you still see something that might make sense to you.