EPUB
An open e-book standard format that is structured as a ZIP archive containing XHTML content files. Metadata, resource manifests, and reading order are defined by the Open Packaging Format (OPF) specification. EPUB is widely adopted for e-book distribution and reading across devices.
Core Facts
An EPUB is essentially a ZIP archive filled with XHTML files
EPUB is an open standard developed by the International Digital Publishing Forum (IDPF, now merged into W3C) and is currently the most widely supported non-proprietary e-book format.
Timeline (last 90 days)
Kobo supports the EPUB format and can borrow library e-books via OverDrive (Libby).
Memorias lets users add their own photos and export to EPUB, PDF or DOCX format.
Even if users can import their own EPUB files, details of the reading experience such as layout rendering, fonts, pagination and footnote navigation still require substantial engineering investment.
Amazon Kindle uses the proprietary AZW/KFX format, Kobo uses the Kepub format, and the open-standard EPUB is widely supported.
Linear text extraction breaks non-linear books: footnotes, sidebars, and quotation boxes are separate XHTML files referenced inline in the body text, and simply extracting text in spine order would omit them or insert them in the wrong place.
The file list is not the reading order, and the table of contents is not the structure either; one should find the manifest that expresses the intent and follow it.
Parsing the spine is the correct way to determine EPUB reading order: for each itemref, resolve its ID to the manifest entry and then read the corresponding file; if a spine entry points to a non-XHTML resource, it should be skipped gracefully.
Alphabetical order, manifest order, or ID naming does not guarantee alignment with the actual human reading order.
In EPUB spine entries, the linear="no" attribute indicates that the document is auxiliary content that can be skipped during linear reading.
EPUB's table of contents file (NCX or nav.xhtml) only describes the navigation structure and may be inconsistent with the spine order, so it cannot serve as the source of truth for reading order.
14 more timeline events
All Facts (20)
An EPUB is essentially a ZIP archive filled with XHTML files
65%VerifiedEPUB is an open standard developed by the International Digital Publishing Forum (IDPF, now merged into W3C) and is currently the most widely supported non-proprietary e-book format.
65%UnverifiedThe true reading order of an EPUB is defined in the package document content.opf
60%UnverifiedKobo supports the EPUB format and can borrow library e-books via OverDrive (Libby).
50%UnverifiedMemorias lets users add their own photos and export to EPUB, PDF or DOCX format.
50%UnverifiedAmazon Kindle uses the proprietary AZW/KFX format, Kobo uses the Kepub format, and the open-standard EPUB is widely supported.
50%UnverifiedEven if users can import their own EPUB files, details of the reading experience such as layout rendering, fonts, pagination and footnote navigation still require substantial engineering investment.
50%UnverifiedParsing the spine is the correct way to determine EPUB reading order: for each itemref, resolve its ID to the manifest entry and then read the corresponding file; if a spine entry points to a non-XHTML resource, it should be skipped gracefully.
50%UnverifiedLinear text extraction breaks non-linear books: footnotes, sidebars, and quotation boxes are separate XHTML files referenced inline in the body text, and simply extracting text in spine order would omit them or insert them in the wrong place.
50%UnverifiedThe file list is not the reading order, and the table of contents is not the structure either; one should find the manifest that expresses the intent and follow it.
50%UnverifiedAlphabetical order, manifest order, or ID naming does not guarantee alignment with the actual human reading order.
50%UnverifiedEPUB's table of contents file (NCX or nav.xhtml) only describes the navigation structure and may be inconsistent with the spine order, so it cannot serve as the source of truth for reading order.
50%UnverifiedIn EPUB spine entries, the linear="no" attribute indicates that the document is auxiliary content that can be skipped during linear reading.
50%UnverifiedA large number of EPUBs in the wild are not valid, so the team implemented a fallback strategy: first attempt strict XML parsing, and on failure use the lxml.html parser.
50%UnverifiedThe team used more than 50 books from different sources for regression testing.
50%UnverifiedPreserve the original DOM as much as possible—even deleting an empty span may break the layout; plan the handling of inline tags early, and stripping tags is only a temporary solution.
50%Unverifiedlxml may turn <p></p> into <p/>, which causes errors in some readers, so the team ultimately switched to a more tolerant HTML parser to handle the many EPUBs that are not strictly valid XML.
50%UnverifiedFixed-layout EPUBs (fixed-layout books where each page is an image) cannot be handled with a text approach and require detection and fallback to OCR or a PDF-like pipeline, which remains an open problem.
50%UnverifiedWhen processing Markdown or EPUB-format e-books, it is necessary to first perform structured parsing and remove non-readable content such as Markdown heading symbols, footnote markers, and image links, otherwise problems such as reading heading symbols aloud and footnotes being mixed into the body text will occur.
50%UnverifiedThe alphabetical order of EPUB filenames has no relationship to the reading order of the book
50%