Perhaps a combination of LaTeX/PreTeXt and Open Monograph Press [1] will do :D
The idea is to allow authors using LaTeX/PreTeXt to pipeline the document+sources to a repository (think GitHub Pages for math textbooks), as well as preserving existing free content whose sources are lost (e.g., old out-of-print books).
The idea is to allow authors using LaTeX/PreTeXt to pipeline the document+sources to a repository (think GitHub Pages for math textbooks), as well as preserving existing free content whose sources are lost (e.g., old out-of-print books).
[1] https://pkp.sfu.ca/omp