I've written over a dozen books.
Have used asciidoc, HTML, word, latex, and rst.
Markdown is the least painful of all. It's not perfect but the others are worse.
(My custom stack uses markdown (or Jupyter notebooks converted to markdown). Pandoc plus some custom filters creates typst (for PDF) or epub.)