News for hackers. Stuff that matters.
Re:From RSS to My Kindle by velcrovan on Wednesday June 26, 2024 @02:56PM (#40803279)
Nit (maybe minor, maybe not): The EPUB standard requires[1] that the `mimetype` file be the first file stored in the ZIP container, and also that it be stored without being compressed.

It doesn't look like the author's code is conforming to this part of the standard.

If that is the case, then their Kindle may be able to tolerate the deviation. But using this code with an e-reader that adheres closely to the EPUB spec may produce broken results.

[1]: https://www.w3.org/TR/epub-33/#sec-zip-container-mime

Re:From RSS to My Kindle by facundo_olano on Wednesday June 26, 2024 @03:19PM (#40803511)
TIL thanks for commenting, I'll make a note to fix this.
Re:From RSS to My Kindle by velcrovan on Wednesday June 26, 2024 @04:06PM (#40804074)
Yeah, understandable given that the "sample-epub-minimal" repo you were going off of effectively says "just zip it all up and you're good to go", which is incorrect. Not sure what the best remedy is there, maybe I'll open a pull request.

[1] https://github.com/thansen0/sample-epub-minimal

Re:From RSS to My Kindle by davidwtbuxton on Thursday June 27, 2024 @07:56AM (#40809532)
My crusty Python code implementing EPUB, with the conforming uncompressed mimetype file as first member in the archive:

https://github.com/davidwtbuxton/ucflib/blob/e576fb97fc2a2ea...

Re:From RSS to My Kindle by velcrovan on Thursday June 27, 2024 @01:29PM (#40812907)
Robin Sloan has a good Ruby project that builds good-looking web pages alongside EPUB files: https://github.com/robinsloan/perfect-edition

It was in porting that to Racket [1] that I learned about some of these EPUB standard details.

But spoiler alert, both projects just shell out to `zip` to do the actual compression.

[1]: https://github.com/otherjoel/perfect-edition-pollen/blob/mas...