Docs
Math
Compile TeX to MathML at build time, with nothing shipped to the browser.
Math is off by default. Turn it on and dollar-delimited TeX compiles to MathML during the build:
build.rs
use proa_docs_build::{Config, MathMode};
let config = Config::new().source(source.markdown(pipeline.math(MathMode::MathMl)));
content/performance.mdx
Render cost is $O(n)$ in the number of dynamic slots, not in template size.
Why MathML rather than KaTeX
The generated markup renders natively in every modern browser. No client JavaScript, no stylesheet, no font.
That is the difference between this and the usual approach. Proa compiles equations during the build and emits MathML. Browser fonts and MathML support determine their appearance; the page does not need a JavaScript math renderer.
| Mode | Behaviour |
|---|---|
MathMode::Disabled (default) | $…$ passes through as literal text |
MathMode::MathMl | TeX compiles to MathML during the build |
Leaving it disabled is correct for most sites — prose that never uses math should not pay for a TeX parser in the build.