I'm writing the book with Lyx. Lyx documents are converted to LaTeX docs, then converted to HTML with pandoc.
Then I have a homemade Go script that generates the VueJs components (one per chapter).
This question is asked a lot so I will write something about the system because it can help other writers.