Maybe we can use `htlatex`, see also [this pdf](http://tug.org/TUGboat/Articles/tb25-1/gurari.pdf) and [the manual](https://www.tug.org/applications/tex4ht/mn.html).