I'm wondering if this post is likely to reveal me as being unduly thick ... but here goes:
I write software for a living (database stuff, payroll mostly but other things too). Part of writing software is writing manuals to help use that software. Being like many software developers, I've been slack in maintaining the help, indeed I haven't really touched it in a few years ... but just recently I received an update notice for the software I use to write it. I only just occurred to me that I could have tried using this software for writing my books. It would be overkill, but it just struck me that it would probably work - and for people wanting more sophistication for production of special ebooks (links and graphics and things) then such software could be worth a serious look.
The software I use (
Help and Manual) is rather expensive compared to other book-writing software mentioned so far, and many others are similarly priced, though there must be some cheaper options out there these days (I started using H&M many years ago).
I think some of the specialised software already mentioned here is a better choice for normal novel writing, but for anyone considering their options such software as I describe above could be worth a look.