I’m (and many others) are using XML via the PreTeXt[1] project. Because of the strict schema, the processors are able to transpile from xml source to LaTeX/pdf, HTML, epub, and more.
The syntax is obnoxious, but I love the results!
[1]: https://pretextbook.org/doc/guide/html/part-author.html