accessible-books-in-browsers

Github project page

About

Transform EPUB with Media Overlays into a series of HTML files for reading directly in the browser.

A typical conversion creates the following files (see an example fileset):

Media Overlays conversion adds the following:

Updates

September 2024

Demos

Viewing these requires an up to date browser, specifically because they use the CSS Custom Highlight API and autoplay permissions.

As of now (Sept 2024), the latest of Chrome, Firefox, and Safari perform reasonably; though in Firefox, the highlight API is experimental right now so support has to be enabled by setting a preference (see their docs for details).

To autoplay the contents from chapter to chapter, go to the page and then go to “site settings” in your browser. Under “audio”, say “allow”. You only have to do this once for the whole demo site (per domain).

These demos were created using this conversion script.

Current features

Feature Basic JS-enhanced
Spine navigation Forward and back through the spine documents with links (shown as arrows) (same)
TOC TOC link opens nav.html TOC loads in sidebar
Page list Page list is within nav.html, use landmarks navigation or click the in-page link at top Page list loads in sidebar and has go-to-page controls
Search Not available Full text search available from sidebar
Publication info Info link opens about.html, containing publication info About page loads in sidebar instead
Keyboard shortcuts Not available Available (see help for details)
Help Opens in new page (same)
Settings Not available Change size, theme, playback rate, page number announcements
Theme Match OS dark theme preference by default Adds ability to turn on/off
Bookmarks Bookmark any heading using your browser (same)
Audio support Play embedded audio for the page with native HTML controls Adds synchronized highlighting and custom controls, including phrase navigation and control over announcing page numbers

Caveats

Conversion

A few things (navigation document consistency across publications; colors in stylesheets or things marked !important) were adjusted manually in the EPUB source; this is, after all, just a prototype. But these aspects can and will be automated in the future.

Approach

Generate a set of HTML pages:

Add javascript enhancements:

What this isn’t:

Spaces to watch

Advances in these areas would make this project better.

Future experiments