Home / Blog Menu ↓

Blog: #marvin

Scroll

A couple weeks ago I built my own EPUB reader called Scroll, and since then have pretty much moved off Marvin. Here’s what Scroll looks like (light and dark themes):

scroll.png

Thus far I’ve read two books using it, and while there are still a few small issues, overall I’m very happy with it. I don’t plan to release it anytime soon, but as a not-even-close-to-the-same-thing substitute, here are some notes:

  • I’d made decent enough progress with epub2pdf that it was usable, but reflowability and theme-changing are nice, and having quick navigation between books is even nicer, and printing a book to PDF in Firefox is slow, and browsers already natively support the HTML that’s inside EPUBs, so I abandoned the PDF route.
  • Scroll (after both the noun and the verb) is a PWA without a backend. It’s actually just static HTML files: I wrote a script that concatenates all the HTML in an EPUB into one long HTML file, with some processing to fix links and wrap things and bake the table of contents out. Then there’s a little bit of vanilla JS for the reader functionality (saving the debounced current scroll location to localStorage (I wish Safari supported scrollend), restoring it on the pageshow event, calculating pagination, jumping to pages, switching themes, etc.), and another vanilla JS file listing the current books (so that I don’t have to re-build all the other book files when I start reading a new book).
  • While I said “pagination” above, I’m not actually chunking the book into pages; I’ve chosen to stick with vertical scrolling for now instead of horizontal paging, primarily because being able to make sub-page progress is nicer than I realized. That said, I still want to know how many “pages” I’ve read, so I use the scroll percentage (scrollTop divided by scrollHeight, super simple) multiplied by a rough heuristic of 1,200 characters per page, ignoring whitespace. It’s not perfect but it’s good enough for my needs.
  • I added a slight blur to the text so that it feels a little less digital. For now I’ve opted against a background image, but I may change my mind about that.
  • Whenever I add/remove a book, I copy the baked files to a private directory on my server
  • I’ve saved the root HTML file (which is just a list of the current books, loaded via JS) to my home screen as a PWA

Reply via email

With Marvin’s recent disappearance from the iOS app store, I’ve started feeling an itch to get my own ebook reading system set up sooner than later — ideally before the sad day comes when I can’t get Marvin to work on my phone anymore.

I’ve tried other iOS ereader apps and they don’t yet meet my needs (and let’s be clear, by “needs” I mean high-maintenance wishes), such as custom fonts, good design, configurable typography, and nice page numbers (ideally the 1,024 characters per page rule that Adobe Digital Editions and Marvin use).

Also, I want to use my phone since I have it with me all the time and can read more often, thus I’m not considering a dedicated ereader like a Kobo or a Kindle. And I have a large collection of ebooks I want to read, so print books don’t meet the need.

The default for me here would be a web app (PWA), with a backend built in Django or FastAPI or Go. That’s probably where I’ll land, but from a research angle I see this as a good time to explore possibilities I wouldn’t normally consider. Some ideas along those lines:

  • PDF — convert EPUBs to phone-sized PDFs automatically and then use a PDF reader like Documents instead of a dedicated EPUB app, possibly with the analog filters I recently posted about
  • Images — convert EPUBs to images (one page per image) and then read via an album in the system photos viewer, deleting each page as I read it (half joking here)
  • HTML — splat the ebooks out into all their HTML files and then put those up on a server behind authentication, reading them in a browser like normal web pages
  • Retro ebook reader — web-based app that feels like a Game Boy or one of those tiny consoles, with a chonky pixel font, possibly using game mechanics for page navigation (I’m intrigued by this idea but in reality it would probably feel super gimmicky)
  • 3D app — deboss the type, procedurally generated paper texture, etc. (also feels gimmicky)
  • Email — export each chapter of the EPUB and then email it to myself (fully joking here) (it would work, sure, but I don’t want to read books in my email)

The PDF and HTML options hold some promise, so I plan to continue exploring them for a bit before I cave and write a PWA.


Reply via email

Lector intro

Yet another entry in the ignominious series talking about my personal productivity tools.

Lector is a reading app for macOS. It’s an Electron app for now. The name comes from the Latin (for someone who reads), with a homophonic hat tip to Hannibal. It came about from wanting a minimalist app that would let me read PDFs and scanned books in dark mode and keep track of my spot across multiple books.

Overview

A Lector book is just a directory full of images. (PDFs have to be split up into image files first, so I have a small script to do that.) When the app starts up, it looks at the book list directory to see what books are available. It also has a JSON file to track where I’m at on each book (which page and which part of the page), what size the window is, which book I last had open, etc.

The app itself looks like this, on an empty desktop to show how I usually use it:

lector.png

No title bar, since I find that distracting. And the page images are scaled by default to fit the window width.

Hitting g / brings up a brief panel showing the books that are in the system, with alphabetized keys to get to them (so g a to go to the first, g b for the second, etc.). When I’m done reading a book, I delete its directory, so these mappings change fairly regularly.

j and f and double-clicking all go to the next page; k and d both go back to the previous page. J and K move up and down the page (in larger jumps), and the mouse can also be used to scroll. (I find that I mostly use the mouse for scrolling and f/d for page navigation, but every once in a while I’ll use the other keys.)

As you can see in the screenshot, it defaults to dark mode, with slightly lowered contrast for easier reading. i inverts the colors and s toggles the higher contrast view.

How I use Lector

I use it when I want to read a book I’ve scanned (usually with Scanbook). I haven’t used it as often lately, but I fully expect that to change soon. (It’s been very handy for reading textbooks.)

I’ve found that I prefer the window size shown in the screenshot, wide (so that the text is large enough) with just enough vertical room for a paragraph or so (since reading in smaller chunks is easier).

The future

I’d like to move off Electron at some point, probably to a native Swift app. Having it support PDFs directly (or splitting them up itself) would be nice, and having a way within the app to remove books would also be good.

Finally, I’d love to add EPUB support at some point. (I haven’t yet found a desktop EPUB reader I like. Marvin’s great on iOS, though.)


Reply via email

On ebooks

For a long time I couldn’t really get into ebooks (in spite of publishing dozens), primarily for nitpicky typographic reasons and because of availability/selection. Over the last few years, however, things changed, and my reading is now pretty much all ebooks.

For EPUBs, I use Marvin on my iPhone and couldn’t be happier with it. (Also, I’ve written a personal-use Python script that replaces f-bombs and other strong profanity in EPUBs with bullet points. Came in handy for Worm, Ra, and UNSONG, all of which I really enjoyed.) In fact, as near as I can remember, reading HPMOR on Marvin was what convinced me ebooks were great. HPMOR also convinced me that fanfiction done well can be amazing. (I liked it better than the originals.)

I’ve also been reading loads of books on Libby, and it’s been great — my public library has a fairly good selection of books on it, and the app itself is far better than the old Overdrive app.

To my surprise, I’ve also started buying books on Kindle. I used to be hesitant to do that (walled garden and all), but I’ve come to terms with it. (To the point that I’ve bought around, uh, 300 books since the beginning of the year. I may have a problem.) (Also, it’s crazy how many books go on sale for a couple dollars. I use eReaderIQ to watch for those sales.) While I do have an old Kindle, I use the app on my phone, since I always have my phone with me. Oh, and the Prime reading library usually has some interesting books, too.

Last but not least, for print books (primarily nonfiction), I tend to scan a chunk of forty to fifty pages using my camera app, turn it into a PDF with Readdle’s Scanner Pro app, and read it using Readdle’s Documents app. That way I can make an “ebook” out of pretty much any print book, letting me read it anywhere without having to lug the physical book around. This method catapulted my nonfiction reading forward, and it’s been great. The only downside is that the scanning takes time, but it’s been worth it. I estimate I’ve read at least 15,000+ pages this way over the past five years.

Overall, I love ebooks. Having them with me all the time is unbeatable. In fact, I just checked and it looks like I haven’t read a print book in over six months. I still love print, but ebooks are the future, at least for me.


Reply via email