This is the kind of thing that is ripe for Typst (https://typst.app/home). There is a CLI interface as well as a web app.
I’ve recently been working on a book using Typst after hacking LaTeX for many years. Through some examples and the docs I’ve already been able to accomplish much more customization on my own, rather than cargo-culting 20-year old snippets and packages, and the results are readable and maintainable. I don’t know if Typst will completely supersede LaTeX, but this point I think it is capable of doing so and I will be upset if it doesn’t.