218 points · by mettamage · 5y ago · 153 comments
You can make copy and paste work normally in Apple Books with the solutions on https://apple.stackexchange.com/q/137047 ‘Don't want iBooks to always paste the “Excerpt From” of what I have copied’.
Firefox addon: Download files and read and modify the browser’s download history, Access browser activity during navigation, Access your data for all web sites
Chrome Web Store obscures the full permission list, but the comments for that extension admits: right "read and change all your data on the websites you visit" needed
It's 2021, you should view all browser addons as a threat.
Presumably if Google decided to add EPUB support, Edge would get it back too, but Microsoft hasn't decided that feature is valuable enough to add onto their modifications.
An ebook, unzip, is rarely bigger than 1Mo, which is lower than what most page are today.
Oh no, we can't have that. Here are some "beautiful, performant and lightweight" Electron ePUB readers/organizers: https://www.electronjs.org/apps?q=epub
Calibre seems to use all the memory after some time and then it starts to use swap memory...
Not the fault of the library developer - they’re just trying to help, but it’s like instead of fixing holes in the ship, we build pumps to dump the water out. Too many pumps on the ship and it gets bloated and can’t take any cargo. This is the current web in a nutshell. We need a ship captain that can guide us authoritatively.
I have tried a lot of browser extension based and standalone readers in the past and they all render things differently with different bugs. Something doesn't add up.
So it's not quite just HTML/CSS when packaged up, but it is just HTML/CSS when it comes to the actual text content.
Other than getting the various constituent files zipped up, with their interrelated contents synced, the only other oddity is that the renamed ZIP must always start with an uncompressed 'mimetype' file.
The IDPF maintain the standard. The easy one is v2 (http://idpf.org/epub/201) but that is now deprecated. Unfortunately v3 allows more interactivity and scripting - and we all know how bad the tech industry is at keeping that kind of stuff secure.
It's XHTML to be precise, and that doesn't change no matter what processing is done by readers, it's still (just) XHTML. The format is literally described in the submission :)
> they all render things differently with different bugs
Just like HTML did in the beginning.
> Just like HTML did in the beginning.
ePub wasn't born yesterday. It's revision 3, first released ~2006/7. XHTML was proposed to correct and prevent the kind of problems html4 had because of how it organically grew, specifically relying on its XML root (no pun intended). Epub should definitely not suffer from bugs like HTML had in the pre-XHTML and pre-HTML5 era.
I sometimes have bugs like:
- whole book is black
- some pages can't be loaded/read so I have to skip them
- some toc and back link don't work like they should (probable bad markup)
There's also some readers oddities:
- completely inconsistent line-height
- aligned setting not working at all
etc.
Anyway, there's a reason XHTML2 didn't happen and we got HTML5 instead. Either ePub has some extensions that are not trivial to implement or most readers are buggy. Or both.
Wait, so you could actually do all of that and then let it interact with APIs as well? When JS gets involved like this, I can see some crazy applications in my mind packaged as an ".epub" book.
I guess it depends on what reader you're targetting then. A quick cursory search shows that not all of them support JS. Makes sense to me.
With epub? I hope not!
> I guess it depends on what reader you're targetting then. A quick cursory search shows that not all of them support JS. Makes sense to me.
Any epub reader supporting javascript would very much be an antifeature.
https://www.w3.org/publishing/epub3/epub-contentdocs.html#se...
https://github.com/phuff/epub_builder
I built it because I wanted to have something that made a daily brief news paper that was personalized and sent to my kindle. It makes an epub and uses kindlegen to convert it to a .mobi. There's a lot of fun epub formatting stuff you can do.
Here's the system that makes the daily newspaper, but it's been so long I'm not sure it's actually functional code outside of my production version:
For example, rendering math on the web has been a solved problem for many years thanks to MathJax and KaTeX, but these require JS, so cannot be used in ePubs (unless you know the reader supports scripting).
If anyone is interested, I wrote a mega blog post about my journey to produce decent-looking math equations inside a ePub (and mobi files): https://minireference.com/blog/generating-epub-from-latex/ some discussion from when I posted on HN https://news.ycombinator.com/item?id=26356903
The struggle to get better at math and find time + motivation for it is real.
I'm the high school textbook guy, if that rings any bells.
I'm doing testing though, and hopefully going to see more MathML in the future (in browsers and ePub readers).
Out of all my epub math textbooks I have exactly one done with MathML and it's fucking glorious compared to the dogshit image based ones most publishers put out with blurry images intended for the 800x600 readers of 2007 and not modern 300 dpi ones. I had one book where literally 2/3rds of the equations were just missing from the file and unviewable on any device. This started on PAGE 7. I then had to ask the publisher to fix it, which they sort of did by replacing with a PDF version.
Despite being HTML/CSS, the layouts aren't particularly interesting though. Most content reads from top to bottom, and the formatting is identical whether you read it on a phone or a tablet.
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)The first is the "Standard Ebooks"[1] toolset, which is a suite of Python scripts to create, process, and build ebooks in all common formats. The results on the Standard Ebooks site speak for themselves. They're impeccable in every way, and far better than many big name, commercially produced efforts.
GitHub: https://github.com/standardebooks/tools
How to use: https://standardebooks.org/contribute/producing-an-ebook-ste...
The second is Sigil, which is a great editor if you prefer to work with a GUI:
GitHub: https://github.com/Sigil-Ebook/Sigil
Homepage: https://sigil-ebook.com/about/
What's even worse - almost all Epub readers don't do proper sandboxing.
I recently published a book and going through the w3c epub specifications was a pain. Instead, I bought a book I wanted to read then reversed engineered it.
For small files you can use the w3c online validator, which will give you an overwhelming list of errors.
Note: The kindle does not support epub, instead it uses kpf. For that you have to download a 333 MB program to convert your epubs.
Java software (jar, war): zip files
Android packages (apk): zip files
OpenDocument Format (odt, ods, odp): zip files
Quake 3 / OpenArena / Urban Terror / etc. (pk3): zip files
Firefox/Thunderbird/Chromium extensions (xpi, crx): zip files
EPUB: :D
If you need to cram a bunch of files into one package, zip is the obvious candidate. There are well-tested libraries and apps for dealing with zips for essentially every language and operating system.
As the saying goes, "don't mess with success".
Care to explain yourselves this time?
EDIT: It would be ok in a live discussion. But on a forum, not so much.
I can recommend Kobo as an e-ink e-reader that supports ePub with one caveat: Kobo requires you to sign-up for a Kobo account before you can even use the device - horrible. It's easy to search online to find a way to bypass this.
Although Kobo is an alternative to Kindle, you won't find the range of titles that Amazon sells. However, I think e-readers are best for text-only, small paperback-sized books. Anything else simply doesn't fit the small screen and is inferior to the physical version of a title. (Amazon sells a lot of Kindle titles that are simply unsuitable for small e-reader screens.)
At least it's possible to strip the DRM on Amazon books with the right set of tools, and Calibre is able to convert them to EPUB.
I do feel that the e-ink reader screen size does matter because reflowed text only works well for small, paperback-sized books. Any book larger than this small size that also features tables, charts, images, diagrams, code listings and more, will not display well on a small e-ink screen.
Is the kobo better in this regard?
- Shows as an external drive when connected via a micro-USB cable
- Copy and paste books, then when you unplug from your laptop your Kobo sees them
- With Calibre you can tag your books; tags become collections on-device
- Understands more formats, but Calibre can also convert to EPUB during copying
- You can also read the Adobe-DRM protected books (or ask Apprentice Alf)
I am thinking of a scenario where, if there is a collapse (societal, economic, political, or technological), how can knowledge be disseminated and preserved in a resilient way?
Even better if the paper and ink can be made onsite, and the printer can is repairable by someone within the nearby geographical region.
http://idpf.org/epub/30/spec/epub30-changes.html#sec-new-cha...
Sure, we all have pleasant visions of truly interactive ebooks driven by creatively built JS content. But in the real world, ads would be the first thing to be added if JS was supported.
I learned this a while back when I was deep in @font-face and web fonts and style sheets.
I was almost immediately discouraged because, modern features like @font-face were inconsistently supported.
Haven’t checked I a while now, maybe it’s better.
- points gun Always has been.