Skip to content

Instantly share code, notes, and snippets.

@jaredh159
Last active August 3, 2018 18:29
Show Gist options
  • Save jaredh159/dab46502e38ff066a81b1a7040649c34 to your computer and use it in GitHub Desktop.
Save jaredh159/dab46502e38ff066a81b1a7040649c34 to your computer and use it in GitHub Desktop.
Epub Helper

Epub misc info

As of July 2018, it looks like we should be authoring EPUB 3.0.1. 3.1 seems to have been an overreach.

Terms

Rendition

A version of an epub. Like fixed-layout and reflowable. An epub author might want to package both in one epub, and the device could determin which or when to show which rendition. The spec also mentions the idea of multiple translations of a work being renditions of a single epub. It also refers to "…​the ability to move from the same spot in one Rendition to the equivalent spot in another as changes in the reading environment occur."

Package Document

An .opf file that describes one Rendition. The package document files are referenced in the META-INF/continer.xml file. For our purposes there is (currently) always only one rendition per document, so one package document. The Package document is an .xhtml doc that contains meta info about the rendition, a manifest of all resources, and a listing of reading order (aka: spine).

Random facts

  • spec allows reader to discard margin/padding top on an element after a page break, which the kindle app on mac seems to do. the only real workaround is to put the item you want to have top margin in it’s own html file within the container.

mobi lols ¯\_(ツ)_/¯

This css:

#footnotes hr {
  display: none;
}

…​caused the mobi7 used by iOS to completely delete the entire footnotes section.

  • using padding-top to give some breathing room at the top of new sections doesn’t work in mobi7, use margin-top instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment