If the documentation is always intended to be read online, is there a reason
not to use MathJax?
https://en.wikipedia.org/wiki/JsMath
JsMath seems to be no longer actively developed and MathJax is very easy to
use as well.
I currently work on a Matlab compatible publish function
https://github.com/siko1056/octave-publish/blob/master/__publish_html_output__.m
where just the equations in $ $ signs must be present + a script include and
the output looks more "natural" than the one of JsMath.
Best,
Kai