{"id":41937,"date":"2024-01-30T15:39:19","date_gmt":"2024-01-30T20:39:19","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=41937"},"modified":"2024-01-30T15:39:19","modified_gmt":"2024-01-30T20:39:19","slug":"portable-epubs","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2024\/01\/30\/portable-epubs\/","title":{"rendered":"Portable EPUBs"},"content":{"rendered":"<p><a href=\"https:\/\/willcrichton.net\/notes\/portable-epubs\/\">Will Crichton<\/a> (via <a href=\"https:\/\/news.ycombinator.com\/item?id=39138042\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/willcrichton.net\/notes\/portable-epubs\/\"><p>Despite decades of advances in document rendering technology, most of the world&rsquo;s documents are stuck in the 1990s due to the limitations of PDF. Yet, modern document formats like HTML have yet to provide a competitive alternative to PDF. This post explores what prevents HTML documents from being portable, and I propose a way forward based on the EPUB format.<\/p><p>[&#8230;]<\/p><p>The act of working with PDFs is relatively fluid. I can download a PDF, quickly open it in a PDF reading system like <a href=\"https:\/\/en.wikipedia.org\/wiki\/Preview_(macOS)\">Preview<\/a>, and keep or discard the PDF as needed. But EPUB reading systems feel comparatively clunky. Loading an EPUB into Apple Books or Calibre will import the EPUB into the application&rsquo;s library, which both copies and potentially decompresses the file. Loading an EPUB on a Kindle requires waiting several minutes for the <a href=\"https:\/\/www.amazon.com\/sendtokindle\">Send to Kindle<\/a> service to complete.<\/p><p>Worse, EPUB reading systems often don&rsquo;t give you appropriate control over rendering an EPUB. For example, to emulate the experience of reading a book, most reading systems will chunk an EPUB into pages. A reader cannot scroll the document but rather <q>turn<\/q> the page, meaning textually-adjacent content can be split up between pages. Whether a document is paginated or scrolled should be a reader&rsquo;s choice, but 3\/4 reading systems I tested would only permit pagination (Calibre being the exception).<\/p><p>Therefore I decided to build a lighter EPUB reading system, <a href=\"https:\/\/github.com\/nota-lang\/bene\/\">Bene<\/a>. You&rsquo;re using it right now. This document is an EPUB &mdash; you can download it by clicking the button in the top-right corner. The styling and icons are mostly borrowed from <a href=\"https:\/\/github.com\/mozilla\/pdf.js\">pdf.js<\/a>. Bene is implemented in <a href=\"https:\/\/tauri.app\/\">Tauri<\/a>, so it can work as both a desktop app and a browser app.<\/p><\/blockquote>\n<p>On the other hand, it doesn&rsquo;t feel like a normal Web page, rendering in a frame unless you view the <a href=\"https:\/\/willcrichton.net\/notes\/portable-epubs\/bene-reader\/epub-content\/EPUB\/index.xhtml\">main HTML file directly<\/a>.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2013\/02\/21\/pdf-js\/\">PDF.js<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Will Crichton (via Hacker News): Despite decades of advances in document rendering technology, most of the world&rsquo;s documents are stuck in the 1990s due to the limitations of PDF. Yet, modern document formats like HTML have yet to provide a competitive alternative to PDF. This post explores what prevents HTML documents from being portable, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2024-01-30T20:39:26Z","apple_news_api_id":"60419f26-af20-47ee-a478-6aef456f5d7b","apple_news_api_modified_at":"2024-01-30T20:39:26Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AYEGfJq8gR-6keGrvRW9dew","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[2543,166,339,93,31,165,30,345,96],"class_list":["post-41937","post","type-post","status-publish","format-standard","hentry","category-technology","tag-calibre","tag-ebooks","tag-html","tag-ibooks","tag-ios","tag-kindle","tag-mac","tag-pdf","tag-web"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/41937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=41937"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/41937\/revisions"}],"predecessor-version":[{"id":41938,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/41937\/revisions\/41938"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=41937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=41937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=41937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}