ePub Accessibility reference: EPUB Accessibility Rule Set
In the kit: .github/skills/epub-accessibility/references/epub-accessibility-rule-set.md.
-
This file as plain text, at
https://letitglow.app/ahg/kit/raw/.github/skills/epub-accessibility/references/epub-accessibility-rule-set.md - Everything in the kit
Copy it into ChatGPT or another assistant
Read the plain text first
ePub Accessibility reference: EPUB Accessibility Rule Set
Part of the epub-accessibility skill. Read this only when the task reaches these sections.
EPUB Accessibility Rule Set
Errors - Block assistive technology access
Each row, with its ID, name, description and WCAG mapping.
| ID | Name | Description | WCAG Mapping |
|---|---|---|---|
| EPUB-E001 | missing-title | <dc:title> is absent or empty in the package document OPF |
WCAG 2.4.2 Page Titled |
| EPUB-E002 | missing-unique-identifier | <dc:identifier> is absent or does not match the unique-identifier attribute on <package> |
N/A (EPUB spec requirement) |
| EPUB-E003 | missing-language | <dc:language> is absent or empty in the package document |
WCAG 3.1.1 Language of Page |
| EPUB-E004 | missing-nav-toc | Navigation document has no <nav epub:type="toc"> element (EPUB 3) or NCX is absent (EPUB 2) |
WCAG 2.4.5 Multiple Ways |
| EPUB-E005 | missing-alt-text | <img> in a content document has no alt attribute (an empty alt="" correctly marks a decorative image) |
WCAG 1.1.1 Non-text Content |
| EPUB-E006 | unordered-spine | Spine <itemref> elements do not produce a logical reading order (duplicate or missing manifest items) |
WCAG 1.3.2 Meaningful Sequence |
| EPUB-E007 | missing-a11y-metadata | Missing any of schema:accessMode, schema:accessibilityFeature or schema:accessibilityHazard (all three are required); schema:accessibilitySummary and schema:accessModeSufficient are recommended |
EPUB Accessibility 1.1 section 2.2 (Package metadata) |
Warnings - Degrade the reading experience
Each row, with its ID, name, description and WCAG mapping.
| ID | Name | Description | WCAG Mapping |
|---|---|---|---|
| EPUB-W001 | missing-page-list | Navigation document has no <nav epub:type="page-list">. Page navigation is recommended when the publication is the equivalent of a print edition; once page navigation is provided, a page list is required |
EPUB Accessibility 1.1 section 3.4.1 (Page navigation) |
| EPUB-W002 | missing-landmarks | Navigation document has no <nav epub:type="landmarks"> element |
WCAG 2.4.1 Bypass Blocks |
| EPUB-W003 | heading-hierarchy | Heading levels are skipped (e.g., <h1> -> <h3>) or the first heading is not <h1> within a document section |
WCAG 2.4.6 Headings and Labels |
| EPUB-W004 | table-missing-headers | Data table has no <th> elements or scope attribute |
WCAG 1.3.1 Info and Relationships |
| EPUB-W005 | ambiguous-link-text | Link text is generic ("click here", "more", "read more") or identical for different destinations | WCAG 2.4.4 Link Purpose |
| EPUB-W006 | color-only-info | Color or visual styling is the only means of conveying information (e.g., required fields in red, status icons without labels) | WCAG 1.4.1 Use of Color |
Tips - Best practices for enhanced accessibility
Each row, with its ID, name and description.
| ID | Name | Description |
|---|---|---|
| EPUB-T001 | incomplete-a11y-summary | schema:accessibilitySummary is present but brief (under 50 words) - more detail improves discoverability |
| EPUB-T002 | missing-author | <dc:creator> is absent - impacts screen reader document identification |
| EPUB-T003 | missing-description | No <dc:description> in package metadata - improves catalog discoverability for AT users |
How to Audit an ePub File
Step 1: Unpack the Container
ePub files are ZIP archives. Extract to examine internal structure:
# Create a working directory and extract
mkdir epub-audit && cp document.epub epub-audit/document.zip
cd epub-audit && unzip document.zip -d extracted
# Locate key files:
# - META-INF/container.xml -> points to the OPF package document
# - *.opf -> package document (metadata, manifest, spine)
# - *nav.xhtml / *toc.ncx -> navigation document
# - *.xhtml / *.html -> content documentsPowerShell equivalent:
$epub = 'document.epub'
$out = 'epub-audit\extracted'
New-Item -ItemType Directory -Path $out -Force | Out-Null
Copy-Item $epub "$out\document.zip"
Expand-Archive "$out\document.zip" -DestinationPath $out -ForceStep 2: Locate the Package Document (OPF)
# Read container.xml to find the rootfile path
cat META-INF/container.xml
# Look for: <rootfile full-path="OEBPS/content.opf" .../>Step 3: Audit Package Metadata (EPUB-E001 through EPUB-E007)
Read the OPF file and check <metadata> section:
<!-- Required metadata checks: -->
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:schema="http://schema.org/">
<!-- EPUB-E001: must be present and non-empty -->
<dc:title>My Book Title</dc:title>
<!-- EPUB-E002: must match unique-identifier on <package> -->
<dc:identifier id="uid">urn:uuid:abc-123</dc:identifier>
<!-- EPUB-E003: must be present -->
<dc:language>en</dc:language>
<!-- EPUB-E007: accessibility metadata -->
<meta property="schema:accessMode">textual</meta>
<meta property="schema:accessMode">visual</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
<meta property="schema:accessibilityFeature">alternativeText</meta>
<meta property="schema:accessibilityHazard">none</meta>
<meta property="schema:accessibilitySummary">This publication conforms to
EPUB Accessibility 1.1 and WCAG 2.2 Level AA.</meta>
</metadata>Check schema:accessMode for all applicable modes:
textual- book has text contentvisual- book has images/chartsauditory- book has audiotactile- book has tactile content
Check schema:accessibilityFeature for all applicable features:
alternativeText- all images have alt textstructuralNavigation- headings and/or TOC presenttableOfContents- TOC navigation presentreadingOrder- logical reading order is definedprintPageNumbers- page numbers map to print editionindex- book has a navigable index
Step 4: Audit Navigation Document (EPUB-E004, EPUB-W001, EPUB-W002)
Locate and read the navigation document (EPUB 3: <item properties="nav"> in manifest):
<!-- Required: Table of Contents -->
<nav epub:type="toc" aria-labelledby="toc-title">
<h2 id="toc-title">Table of Contents</h2>
<ol>
<li><a href="chapter01.xhtml">Chapter 1: Introduction</a></li>
<li><a href="chapter02.xhtml">Chapter 2: Getting Started</a></li>
</ol>
</nav>
<!-- Recommended: Page List (EPUB-W001) -->
<nav epub:type="page-list" aria-label="Page list" hidden="">
<ol>
<li><a href="chapter01.xhtml#pg1">1</a></li>
...
</ol>
</nav>
<!-- Recommended: Landmarks (EPUB-W002) -->
<nav epub:type="landmarks" aria-label="Landmarks" hidden="">
<ol>
<li><a epub:type="toc" href="nav.xhtml#toc">Table of Contents</a></li>
<li><a epub:type="bodymatter" href="chapter01.xhtml">Start of Content</a></li>
</ol>
</nav>For EPUB 2, check NCX (toc.ncx) for <navMap> completeness.
Step 5: Audit Content Documents (EPUB-E005, EPUB-W003 through EPUB-W006)
Scan each XHTML content document referenced in the spine:
Image alt text (EPUB-E005):
# Find all img tags - check for alt attribute
grep -n '<img' *.xhtml | grep -v 'alt='
# Any match = missing alt textHeading hierarchy (EPUB-W003):
# Extract heading tags to verify sequence
grep -n '<h[1-6]' chapter01.xhtml
# Must start at h1 and not skip levelsTable headers (EPUB-W004):
# Find tables without th elements
grep -l '<table' *.xhtml | while read f; do
if ! grep -q '<th' "$f"; then echo "$f is missing table headers"; fi
doneAmbiguous links (EPUB-W005):
grep -n '>click here\|>read more\|>more<\|>here<' *.xhtmlRemediation Guidance
EPUB-E001 - Add document title
In the OPF <metadata> block, add or correct:
<dc:title>Full Title of the Publication</dc:title>EPUB-E003 - Add language
<dc:language>en</dc:language>Use BCP 47 language codes: en for English, en-US for American English, fr for French, etc.
EPUB-E004 - Add navigation document (EPUB 3)
Create nav.xhtml. Reference it in the manifest with properties="nav":
<!-- In OPF manifest -->
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>Minimum navigation document structure:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:epub="http://www.idpf.org/2007/ops"
lang="en" xml:lang="en">
<head><title>Navigation</title></head>
<body>
<nav epub:type="toc" aria-labelledby="toc-title">
<h1 id="toc-title">Table of Contents</h1>
<ol>
<!-- one <li><a href="...">Chapter title</a></li> per spine item -->
</ol>
</nav>
</body>
</html>EPUB-E005 - Fix missing alt text
Informative image - describe what the image shows and why it matters:
<img src="chart-revenue.png" alt="Bar chart showing revenue growth from $2M in 2022 to $5M in 2024"/>Decorative image - use an empty alt. Adding role="presentation" is redundant:
<img src="ornamental-divider.png" alt=""/>Complex image (chart/diagram) - provide short alt text + long description:
<figure>
<img src="org-chart.png" alt="Organisation chart - see description below"
aria-describedby="org-desc"/>
<figcaption id="org-desc">
The organisation chart shows CEO at the top, with three direct reports:
CFO, CTO, and COO. Each has two department heads reporting to them.
</figcaption>
</figure>EPUB-E007 - Add accessibility metadata
Required discovery metadata (accessMode, accessibilityFeature, accessibilityHazard), the recommended summary, and the conformance claim. EPUB Accessibility 1.1 section 3.5 requires the claim as a dcterms:conformsTo meta whose value matches the pattern "EPUB Accessibility 1.1 - WCAG [version] Level [A or AA]" exactly, and an a11y:certifiedBy property naming who evaluated the publication. The <link rel="dcterms:conformsTo"> form is not the 1.1 claim.
<meta property="schema:accessMode">textual</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
<meta property="schema:accessibilityHazard">none</meta>
<meta property="schema:accessibilitySummary">
This publication meets EPUB Accessibility 1.1 and WCAG 2.2 Level AA.
All images have alternative text. Structure navigation is provided via
headings and table of contents.
</meta>
<!-- Conformance claim -->
<meta property="dcterms:conformsTo" id="conf">EPUB Accessibility 1.1 - WCAG 2.2 Level AA</meta>
<meta property="a11y:certifiedBy">Name of the evaluating party</meta>EPUB-W003 - Fix heading hierarchy
In the content document XHTML, headings must start at <h1> (or the appropriate level for the document's section role) and must not skip levels:
<!-- Wrong - skips from h1 to h3 -->
<h1>Chapter 1</h1>
<h3>Section A</h3>
<!-- Correct -->
<h1>Chapter 1</h1>
<h2>Section A</h2>If the publication uses epub:type="chapter", each chapter may restart at <h1>. If it uses a continuous document model, headings are nested throughout.
EPUB-W004 - Fix table headers
<!-- Before: no headers -->
<table>
<tr><td>Name</td><td>Score</td><td>Grade</td></tr>
<tr><td>Alice</td><td>95</td><td>A</td></tr>
</table>
<!-- After: proper headers with scope -->
<table>
<caption>Student Grades</caption>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Score</th>
<th scope="col">Grade</th>
</tr>
</thead>
<tbody>
<tr><td>Alice</td><td>95</td><td>A</td></tr>
</tbody>
</table>