Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes to this project are documented here. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this project follows [Semantic Versioning](https://semver.org/).

## [0.24.0] - 2026-11-24

### Added

- Contextualizations for comics roles: a `panel` reads its label, or "Panel." without one; `panelGroup` reads "Panel group.", `bubble` "Speech bubble." and `sound` "Sound:". `panel` is contextualized from the `few` verbosity preset, the others at `most`.
- A comics role (`panelGroup`, `panel`, `bubble`, `sound`) drops every other role on its node when contextualized, e.g. the `region` of `<section role="region" epub:type="panel">` or the `image` of a panel with `role="img"`. Roles that drop every other role don't drop each other, so two comics roles on one node are both read.

### Changed

- `@readium/guided-navigation` is `^1.5.0`, which produces the comics roles, and `@readium/decorator` `^1.4.4`.
- A node's description is read after its announcements and before its content, instead of after its content.

## [0.23.0] - 2026-11-23

### Changed
Expand Down
9 changes: 4 additions & 5 deletions docs/UtteranceExtraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ A node's `<p>` and `<s>` are not kept in `ssml`: paragraphs come from GND roles,

Drops a role and its whole subtree — content and announcement both — from the output. The exported [`skippableRoles`](#role-sets) lists the roles meant to be skipped. `skip` ignores the roles [`interruptions`](#interruptions) controls.

A role a more specific one on the same node drops isn't skipped either: skipping `aside` keeps `<aside epub:type="footnote">`, which `skip: ["footnote"]` drops instead. A `pullquote` or a `cover` drops its `aside`/`blockquote` or `image` this way only when contextualized.
A role a more specific one on the same node drops isn't skipped either: skipping `aside` keeps `<aside epub:type="footnote">`, which `skip: ["footnote"]` drops instead. A `pullquote` or a `cover` drops its `aside`/`blockquote` or `image` this way only when contextualized, and a comics role (`panelGroup`, `panel`, `bubble`, `sound`) every other role on its node. Roles that drop every other role don't drop each other.

### `contextualize`

Expand Down Expand Up @@ -458,9 +458,8 @@ Unlike `segmentation.suppressions`, this table is flat, not per-language — the

A node's `description` (alt text, an ARIA name, a caption) is spoken as its own utterance, in the language it's declared in, like content: the content's when undeclared, `languageOverrides` applied.

- **After the content**, before a block role's `end` announcement, for every role but `table`.
- **Before the rows** for `table`, since its description is its caption.
- **Folded into the announcement** instead, through `{{ description }}`, when the node is contextualized as `audio`, `video`, `image`, `figure`, `math`, `table` or `cover`: "Table: Team roster. 3 lines. 2 columns." It's then not spoken separately.
- **After the node's announcements, before its content**: "Start of the aside.", "Lighthouse facts", then the sidebar's text for `<aside epub:type="sidebar" aria-label="Lighthouse facts">`.
- **Folded into the announcement** instead, through `{{ description }}`, when the node is contextualized as `audio`, `video`, `image`, `figure`, `math`, `table`, `cover` or `panel`, and that role isn't [dropped](#skip) by another on the node: "Table: Team roster. 3 lines. 2 columns." It's then not spoken separately.

`math` never speaks its own text, since math markup can't be voiced reliably: only its description, or "Math formula with no label." when contextualized without one. A `figure` without a description is never announced, even when contextualized; its content still plays.

Expand Down Expand Up @@ -549,7 +548,7 @@ Generated by `npm run generate-role-sets`.
`blockLevelRoles`, the roles that start a block, for [`segmentation`](#segmentation) and `autoPause: "block"` (see [Preferences](Preferences.md#prosody)):

<!-- generated:blockLevelRoles -->
`abstract`, `acknowledgments`, `afterword`, `appendix`, `article`, `aside`, `audio`, `bibliography`, `blockquote`, `cell`, `chapter`, `colophon`, `columnheader`, `conclusion`, `dedication`, `endnotes`, `epigraph`, `epilogue`, `errata`, `example`, `figure`, `footnote`, `foreword`, `glossary`, `heading1`, `heading2`, `heading3`, `heading4`, `heading5`, `heading6`, `image`, `index`, `introduction`, `list`, `listItem`, `math`, `notice`, `paragraph`, `part`, `preface`, `preformatted`, `prologue`, `pullquote`, `qna`, `row`, `rowheader`, `section`, `summary`, `table`, `tip`, `video`
`abstract`, `acknowledgments`, `afterword`, `appendix`, `article`, `aside`, `audio`, `bibliography`, `blockquote`, `bubble`, `cell`, `chapter`, `colophon`, `columnheader`, `conclusion`, `dedication`, `endnotes`, `epigraph`, `epilogue`, `errata`, `example`, `figure`, `footnote`, `foreword`, `glossary`, `heading1`, `heading2`, `heading3`, `heading4`, `heading5`, `heading6`, `image`, `index`, `introduction`, `list`, `listItem`, `math`, `notice`, `panel`, `panelGroup`, `paragraph`, `part`, `preface`, `preformatted`, `prologue`, `pullquote`, `qna`, `row`, `rowheader`, `section`, `sound`, `summary`, `table`, `tip`, `video`
<!-- /generated:blockLevelRoles -->

A `term` followed by a `definition` among its siblings, like `<dt>`, also starts a block; an inline `<dfn>`, also a `term`, doesn't.
Expand Down
4 changes: 4 additions & 0 deletions docs/Verbosity.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ A contextualized role gets an announcement from the [contextualization catalog](
| `bibliography` | block | | | ✓ |
| `biblioref` | inline | | | ✓ |
| `blockquote` | inline | | ✓ | ✓ |
| `bubble` | inline | | | ✓ |
| `caption` | inline | ✓ | ✓ | ✓ |
| `chapter` | block | | ✓ | ✓ |
| `colophon` | inline | | | ✓ |
Expand Down Expand Up @@ -88,6 +89,8 @@ A contextualized role gets an announcement from the [contextualization catalog](
| `notice` | inline | | ✓ | ✓ |
| `pagebreak` | inline | | | ✓ |
| `pagelist` | block | | | ✓ |
| `panel` | inline | ✓ | ✓ | ✓ |
| `panelGroup` | inline | | | ✓ |
| `part` | inline | | ✓ | ✓ |
| `preface` | block | | | ✓ |
| `preformatted` | — | | ✓ | ✓ |
Expand All @@ -97,6 +100,7 @@ A contextualized role gets an announcement from the [contextualization catalog](
| `row` | inline | | ✓ | ✓ |
| `rowheader` | inline | | ✓ | ✓ |
| `separator` | inline | | | ✓ |
| `sound` | inline | | | ✓ |
| `subtitle` | inline | | ✓ | ✓ |
| `summary` | inline | | | ✓ |
| `table` | inline/block | inline | block | block |
Expand Down
296 changes: 296 additions & 0 deletions fixtures/bubble-epub-type/utterances.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
{
"cases": [
{
"options": [
{
"format": "plain"
}
],
"utterances": [
{
"plain": "The keeper says: \"Nearly there.\""
}
]
},
{
"options": [
{
"format": "plain",
"contextualize": [
"bubble"
]
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"segmentation": {
"mode": "sentence"
}
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"segmentation": {
"mode": "sentence",
"reconstruct": true
}
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"language": "always"
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"language": "always",
"segmentation": {
"mode": "sentence"
}
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"language": "always",
"segmentation": {
"mode": "sentence",
"reconstruct": true
}
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"language": "block-level"
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"language": "block-level",
"segmentation": {
"mode": "sentence"
}
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"language": "block-level",
"segmentation": {
"mode": "sentence",
"reconstruct": true
}
}
],
"utterances": [
{
"plain": "Speech bubble.",
"language": "en"
},
{
"plain": "The keeper says: \"Nearly there.\""
}
]
},
{
"options": [
{
"format": "plain",
"contextualize": [
"bubble"
],
"language": "none"
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"language": "none",
"segmentation": {
"mode": "sentence"
}
},
{
"format": "plain",
"contextualize": [
"bubble"
],
"language": "none",
"segmentation": {
"mode": "sentence",
"reconstruct": true
}
}
],
"utterances": [
{
"plain": "Speech bubble."
},
{
"plain": "The keeper says: \"Nearly there.\""
}
]
},
{
"options": [
{
"format": "ssml"
}
],
"utterances": [
{
"ssml": "The keeper says: \"Nearly there.\""
}
]
},
{
"options": [
{
"format": "ssml",
"contextualize": [
"bubble"
]
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"segmentation": {
"mode": "sentence"
}
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"segmentation": {
"mode": "sentence",
"reconstruct": true
}
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"language": "always"
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"language": "always",
"segmentation": {
"mode": "sentence"
}
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"language": "always",
"segmentation": {
"mode": "sentence",
"reconstruct": true
}
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"language": "block-level"
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"language": "block-level",
"segmentation": {
"mode": "sentence"
}
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"language": "block-level",
"segmentation": {
"mode": "sentence",
"reconstruct": true
}
}
],
"utterances": [
{
"ssml": "Speech bubble.",
"language": "en"
},
{
"ssml": "The keeper says: \"Nearly there.\""
}
]
},
{
"options": [
{
"format": "ssml",
"contextualize": [
"bubble"
],
"language": "none"
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"language": "none",
"segmentation": {
"mode": "sentence"
}
},
{
"format": "ssml",
"contextualize": [
"bubble"
],
"language": "none",
"segmentation": {
"mode": "sentence",
"reconstruct": true
}
}
],
"utterances": [
{
"ssml": "Speech bubble."
},
{
"ssml": "The keeper says: \"Nearly there.\""
}
]
}
]
}
Loading