If you look on Project Gutenberg, they have all of the different filetypes already created and stored, probably with a database.
Nostr already has a database, tho (relays, an event store), where we're storing the books as events, which are the smallest, simplest building blocks of such documents. So we can always work parts-to-whole and generate any other view on the fly, including HTML. With a book, you don't need the speed and convenience of a websocket, as the text hardly changes and there's hardly any interaction. It's just you, staring at a long text, occasionally highlighting something interesting, and maybe submitting a review of the book, at the end (like we do for relays).