Skip to content
Open
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Guided Navigations Objects <strong class="rfc">should</strong> include one or mo
| `textref` | References a textual resource or a fragment of it. | URI reference |
| `videoref` | References a video resource or a fragment of it. | URI reference |
| `children` | Items that are children of the containing Guided Navigation Object. | Guided Navigation Objects |
| `colspan` | Number of columns spanned by a `cell`, `columnheader` or `rowheader`, mirroring HTML's `colspan` attribute. Defaults to 1 and must not be present on any other role. | Integer (≥ 1) |
| `rowspan` | Number of rows spanned by a `cell`, `columnheader` or `rowheader`, mirroring HTML's `rowspan` attribute. Defaults to 1 and must not be present on any other role. | Integer (≥ 1) |


## 2. Relationship to the Readium Web Publication Manifest
Expand Down
166 changes: 165 additions & 1 deletion examples/read-aloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"plain": "And the next pagebreak is in the middle of a sentence.",
"ssml": "And the next pagebreak is in the middle <readium:pagebreak id=\"page5\" /> of a sentence.",
"language": "en"
}
},
"children": [
{
"role": ["pagebreak"],
Expand Down Expand Up @@ -304,3 +304,167 @@

* This text has a footnote in the same resource and an endnote.
* This is a paragraph without a footnote.

## Tables

### HTML

```html
<table>
<caption>Council budget (in £) 2018</caption>
<thead>
<tr>
<th scope="col">Items</th>
<th scope="col">Expenditure</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Donuts</th>
<td>3,000</td>
</tr>
<tr>
<th scope="row">Stationery</th>
<td>18,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Totals</th>
<td>21,000</td>
</tr>
</tfoot>
</table>
```

### JSON

```json
{
"role": ["table"],
"children": [
{
"role": ["tableHead"],
"children": [
{ "role": ["row"], "children": [
{ "role": ["columnheader"], "text": "Items" },
{ "role": ["columnheader"], "text": "Expenditure" }
]}
]
},
{
"role": ["tableBody"],
"children": [
{ "role": ["row"], "children": [
{ "role": ["rowheader"], "text": "Donuts" },
{ "role": ["cell"], "text": "3,000" }
]},
{ "role": ["row"], "children": [
{ "role": ["rowheader"], "text": "Stationery" },
{ "role": ["cell"], "text": "18,000" }
]}
]
},
{
"role": ["tableFooter"],
"children": [
{ "role": ["row"], "children": [
{ "role": ["rowheader"], "text": "Totals" },
{ "role": ["cell"], "text": "21,000" }
]}
]
}
]
}
```

### Read-aloud output

* Table with 2 columns and 4 rows.
* Items: Donuts. Expenditure: 3,000.
* Items: Stationery. Expenditure: 18,000.
* Footer: Totals. 21,000.
* End of table.

## Table cell spans

### HTML

```html
<table>
<caption>Weekly stock check</caption>
<thead>
<tr>
<th scope="col">Category</th>
<th scope="col">Item</th>
<th scope="col">Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" rowspan="2">Bakery</th>
<td>Donuts</td>
<td>12</td>
</tr>
<tr>
<td>Bagels</td>
<td>8</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">No stock movement reported for Produce this week.</td>
</tr>
</tfoot>
</table>
```

### JSON

```json
{
"role": ["table"],
"children": [
{
"role": ["tableHead"],
"children": [
{ "role": ["row"], "children": [
{ "role": ["columnheader"], "text": "Category" },
{ "role": ["columnheader"], "text": "Item" },
{ "role": ["columnheader"], "text": "Quantity" }
]}
]
},
{
"role": ["tableBody"],
"children": [
{ "role": ["row"], "children": [
{ "role": ["rowheader"], "rowspan": 2, "text": "Bakery" },
{ "role": ["cell"], "text": "Donuts" },
{ "role": ["cell"], "text": "12" }
]},
{ "role": ["row"], "children": [
{ "role": ["cell"], "text": "Bagels" },
{ "role": ["cell"], "text": "8" }
]}
]
},
{
"role": ["tableFooter"],
"children": [
{ "role": ["row"], "children": [
{ "role": ["cell"], "colspan": 3, "text": "No stock movement reported for Produce this week." }
]}
]
}
]
}
```

### Read-aloud output

* Table with 3 columns and 4 rows.
* Category: Bakery. Item: Donuts. Quantity: 12.
* Category: Bakery. Item: Bagels. Quantity: 8.
* Footer: No stock movement reported for Produce this week.
* End of table.
6 changes: 6 additions & 0 deletions roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
| `separator` | | `separator` | `<hr>` | Indicates the element is a divider that separates and distinguishes sections of content or groups of menuitems. |
| `summary` | | | `<summary>` | A summary of an element contained in details. |
| `table` | [`table`](https://www.w3.org/TR/epub-ssv-11/#sec-tables) | `table` | `<table>` | A structure containing data or content laid out in tabular form. |
| `tableHead` | | | `<thead>` | Section of the table holding header rows. |
| `tableBody` | | | `<tbody>` | Section of the table holding body rows. |
| `tableFooter` | | | `<tfoot>` | Section of the table holding footer rows. |
| `term` | [`glossterm`](https://w3c.github.io/epub-specs/epub33/ssv/#h_glossaries) | `term` | `<dfn>` or `<dt>` | A word or phrase with a corresponding definition.|
| `video` | | | `<video>` | Embedded videos, movies, or audio files with captions in a document.|

Expand Down Expand Up @@ -134,6 +137,9 @@
* `bubble`
* `sound`
* `table`
* `tableHead`
* `tableBody`
* `tableFooter`
* `columnheader`
* `rowheader`
* `row`
Expand Down
29 changes: 29 additions & 0 deletions schema/document.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
},
"description" : {
"$ref": "description.schema.json"
},
"colspan": {
"type": "integer",
"minimum": 1
},
"rowspan": {
"type": "integer",
"minimum": 1
}
},
"anyOf": [
Expand All @@ -78,6 +86,27 @@
{
"required": ["children"]
}
],
"allOf": [
{
"$comment": "colspan/rowspan are only meaningful on cell, columnheader, or rowheader roles",
"if": {
"required": ["role"],
"properties": {
"role": {
"type": "array",
"contains": { "enum": ["cell", "columnheader", "rowheader"] }
}
}
},
"then": true,
"else": {
"allOf": [
{ "not": { "required": ["colspan"] } },
{ "not": { "required": ["rowspan"] } }
]
}
}
]
}
}
Expand Down
3 changes: 3 additions & 0 deletions schema/roles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"subtitle",
"summary",
"table",
"tableBody",
"tableFooter",
"tableHead",
"term",
"textRangeSmall",
"textRangeLarge",
Expand Down
Loading