BookStack
BookStack copied to clipboard
EPUB Book Export
Description: I would like the ability to export an entire book directly to an epub format suitable for delivering to an ebook reader for offline viewing.
Benefits: This would allow for offline viewing of a book on an ebook reader, smart phone, or PC.
Sorry - my bad- I'm remembering a discord discussion not and issue - all bleeding together!
Yeah, I did search for epub, and I found issue #43, but it seems to be focused more on importing items than an output format. It's easy for different support channels to bleed together.
So - I've looked into this - there's one (OLD) PHP class that does epub exports - it doesn't work with PHP 7.3/7.4 as far as I can tell (or any PHP 7.x version!)
MediaWiki have an epub export extension - I'm going to take a look at that and see what they're doing under the hood (if it's still current!)
Would it perhaps be possible to do something along the lines of what pressbooks do, use underlaying software installed on the server to export to different formats. Install instructions show the different types of software you need to have installed to be able to export to the different formats.
ePub is an open standard, and the spec is available here. Building one from scratch isn't difficult, mostly some templated XML and a folder structure. The container is just a renamed ZIP file. You may already be partway there with your contained HTML export.
There are some libraries on packagist that can make this potentially easier. I might poke at a hack if I have time.
More in-depth structure info here: https://www.hxa.name/articles/content/epub-guide_hxa7241_2007.html