W3C EPUB Specifications

repository·main·Indexed 18 days ago

https://github.com/w3c/epub-specs

Development and maintenance repository for EPUB 3 specifications by the W3C Publishing Maintenance Working Group. Includes documentation for EPUB 3.3 Recommendations and EPUB 3.4 Editor's Drafts, covering core file formats, reading systems, accessibility (1.1 and 1.2), and annotation vocabularies. Provides technical details on the EPUB packaging structure (OPF), security and privacy considerations, and guidelines for accessibility conformance using tools like Ace by DAISY.

Tokens
16.4K
Snippets
25
Records
58
Agent score
63%

What's inside w3c-epub-specs

  1. Understand the EPUB specification repository structure

    main

    The repository is organized into folders based on the specification version or development status:

    • archive: Specifications no longer in active development (either finished or abandoned).
    • epub33: Specifications revised as part of the EPUB 3.3 revision.
    • epub34: Specifications currently being revised as part of the EPUB 3.4 revision.
  2. Understand the EPUB 3.3 specification components

    main

    EPUB 3.3 is a packaging mechanism for web content (HTML, CSS, images, video) designed for electronic books. It is not rendered directly in browsers but by EPUB reading systems (user agents like apps or web apps).

    Key specifications included in EPUB 3.3:

    • EPUB 3.3 Overview: Non-normative overview.
    • EPUB 3.3 Core: The specification of the file format.
    • EPUB 3.3 Reading Systems: Specification for user agents.
    • EPUB Accessibility 1.1 and EPUB Accessibility Techniques 1.1: Standards for accessibility.

    Note that EPUB reading systems may rewrite HTML/CSS for pagination, inject scripts, or provide UI affordances, meaning the author does not have total control over the end-user experience.

  3. Use Manifest Properties in EPUB

    main

    Manifest properties allow you to describe specific characteristics of items within the EPUB manifest. These properties are applied to the item element using the properties attribute.

    Commonly used manifest properties in production include:

    • cover-image: Identifies the item as the cover image.
    • mathml: Indicates the item contains MathML.
    • nav: Indicates the item is a navigation document.
    • remote-resources: Indicates the item contains remote resources.
    • scripted: Indicates the item contains scripts.
    • svg: Indicates the item contains SVG.
    • switch: Indicates the presence of the deprecated switch element.
    <!-- Example of applying a manifest property to an item -->
    <item id="cover" href="cover.jpg" properties="cover-image" />
    <item id="math" href="math.xhtml" properties="mathml" />
  4. Use General Package Rendering Properties

    main

    General package rendering properties control how the EPUB content is displayed. These properties can be applied globally via the meta element's property attribute or as specific overrides for individual items using the itemref element's properties attribute.

    Available Properties in Production:

    • rendition:flow: Used for general flow control.
    • rendition:flow-auto: Used for automatic flow.
    • rendition:flow-paginated: Used for paginated content.
    • rendition:flow-scrolled-continuous: Used for continuous scrolling.
    • rendition:flow-scrolled-doc: Used for document-style scrolling.
    • rendition:align-x-center: Used for horizontal alignment.
  5. Understand the requirements for EPUB Accessibility 1.1 conformance

    main

    To advance the EPUB Accessibility 1.1 specification to W3C Proposed Recommendation, implementation of its features must be documented. Specifically, it must be proven that the metadata defined in the specification is being used by target communities.

    Usage is measured by the regular inclusion of two specific categories of metadata in the package document metadata of EPUB publications:

    1. schema.org metadata: Required and recommended metadata for describing the accessibility of publications.
    2. EPUB-defined metadata properties: Properties used for reporting specific aspects of conformance.
  6. Use Meta Properties in EPUB

    main

    Meta properties allow you to provide additional metadata in an EPUB publication. These properties are implemented using the property attribute on the <meta> element.

    When choosing which meta properties to use, consider the current industry adoption. For example, properties like role, title-type, identifier-type, and file-as have widespread support among major publishers and reading systems, whereas meta-auth is deprecated and should not be used.

  7. EPUB Packaging Structure

    main

    An EPUB is a ZIP archive. To be valid, it must follow a specific structure adapted from the Open Document Format:

    1. A mimetype file.
    2. A mandatory META-INF folder containing a container.xml file.
    3. The container.xml file must point to the Package File (OPF).

    The Package File (OPF) is the core of the EPUB, containing:

    • Publication Metadata: Information about the book.
    • Manifest: A list of every resource used in the publication.
    • Spine: The linear sequence of content files (the reading order).
  8. Modify the EPUB Annotation vocabulary

    main

    To make changes to the EPUB Annotation vocabulary, you must only edit the following source files:

    1. index.yml: The primary data source for the vocabulary.
    2. template.html: The template used for generation.

    After modifying these files, you must run the generation process using yml2vocab to update the rest of the files in the directory.

  9. Use Link Properties in EPUB

    main

    Link properties are used to provide additional context or metadata about a link. They are implemented using the properties attribute on the link element.

    Implementation: Add the desired property to the properties attribute of a link element.

    Production Example:

    • The onix property is currently used in production by organizations such as Advantage | ForbesBooks, KnowledgeWorks Global Ltd., Liturgical Press, Macmillan Learning, and Taylor & Francis.
  10. Understand security and privacy implications in EPUB 3.3

    main

    Security and privacy in EPUB 3.3 are largely determined by the architecture and business model of the EPUB reading system (user agent) rather than the specification itself. Because EPUBs use embedded technologies like HTML, SVG, XML, and CSS, they inherit the security models of those technologies.

    Key considerations for developers building reading systems include:

    • Scripting: Scripting follows the HTML model. Many reading systems choose to disable scripting entirely to mitigate risks. If enabled, risks are similar to those found in standard web browsers.
    • Origin Isolation: The specification suggests (non-normatively) that reading systems should treat each EPUB as a unique origin to maintain isolation.
    • Device Orientation: EPUB requires user agents to respond to device orientation (portrait | landscape), specifically for fixed-layout EPUBs.
    • Data Exposure: While the spec does not mandate the collection of personal information, reading systems often track reading habits (position, highlights, notes, progress, and user preferences) to improve user experience or for publisher analytics.
    • Sensor Access: EPUB does not introduce new APIs for sensor access (like geolocation); any such access would occur through existing web APIs if the reading system allows it.
  11. Understand the EPUB 3.3 Candidate Recommendation Exit Criteria

    main

    The EPUB 3.3 specification is currently in the Candidate Recommendation stage. To advance to Proposed Recommendation, the Working Group requires documented proof of implementation for each feature. Specifically, metadata defined in the specification must demonstrate sufficient usage by target communities in two categories:

    1. Package Document Metadata: Information about the publication contained within the package document (primarily used by publishers).
    2. Rendering Metadata: Information expressing preferred rendering of the content (used by reading system developers for bookshelves, content rendering, etc.).

    Usage is verified by observing whether organizations regularly include this metadata in package documents or utilize it within reading systems.