I have written several books.
I used Markdown for the first one.
Then someone recommended AsciiDoc and AsciiDoctor. It was a much better experience compared to Markdown. Sure, not for pixel perfect tweaking. Still enough parameters to play with. Easy to create PDFs and EPUBs.