4 ms·
It's pretty easy to write code that generates and displays EPUB2. EPUB3 is a dog's breakfast -- it's hard to think of a better example of "second system effect
by Turing_Machine 6y ago
It's pretty easy to write code that generates and displays EPUB2.
EPUB3 is a dog's breakfast -- it's hard to think of a better example of "second system effect". As far as I know, there's still not even one reference implementation that supports the full standard, even though it's been out for nearly 10 years. It gains you very little over EPUB2 for standard novels written in western scripts. EPUB3 is only needed if you require embedded scripting, support for non-alphabetical or bidirectional scripts, etc. I believe that most commercial "EPUB3" files still have an EPUB2 toc.ncx file and are designed to fall back to EPUB2 if the reader doesn't support EPUB3 (there are a lot of readers like this).
Something that's easy to overlook: "The mimetype file must be a text document in ASCII that contains the string application/epub+zip. It must also be uncompressed, unencrypted, and the first file in the ZIP archive".
All the other files in the ZIP can be compressed normally.
What this means in practice is that uncompressing an EPUB is easy (just rename it to .zip, if necessary, and run unzip), but recompressing it requires some care.
Assuming you've got your book's content in an OEBPS folder, and the container XML file in the META-INF folder, you can do it like this:
zip -X0 test.epub mimetype
zip -X9Dr test.epub META-INF OEBPS
(edit to fix code formatting)
- BlueTemplar 6y agoWait, so what is the difference between .epub and .mhtml already ?