Only it wouldn't. \KaTeX renders HTML pages, but it doesn't render an entire document. I didn't find support for page numbers or chapters, nor did I find \tableofcontents
command in the list of supported functions. It doesn't support commutative diagrams yet. If you need these diagrams, have a look at MathJax and tikzcd.
Mathematical formulas
Here's a small collections of mathematical formulas rendered by \KaTeX:
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
I've found these examples at tiddlywiki.com. That page also has several more examples.
Chemical formulas
\KaTeX ships with the mhchem extension, so it also renders chemical formulas:\ce{H+ + OH- <=> H2O}
\ce{Zn^2+ <=>[+ 2OH-][+ 2H+] $\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$ <=>[+ 2OH-][+ 2H+] $\underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}$}
You can find many more examples at mhchem.github.io/MathJax-mhchem/.
Angular, React.js, Vue.js, and node.js
There are wrapper libraries for Angular, React, Vue, and several others. You can also use \KaTeX in node.js on the server side. See the full list of extensions on the \KaTeX documentation pages. However, it's also very easy to use the core library, as this page demonstrates.