readium / go-toolkit

A toolkit for ebooks, audiobooks and comics written in Go
https://readium.org/web
BSD 3-Clause "New" or "Revised" License
41 stars 14 forks source link

Infer `accessibility` and `numberOfPages` metadata #65

Closed mickael-menu closed 1 year ago

mickael-menu commented 1 year ago

numberOfPages inference

When the metadata.numberOfPages property is missing from the manifest, use the --infer-page-count flag to fill it using the generated position list.

Accessibility metadata inference

rwp manifest can infer additional accessibility metadata when they are missing, with the --infer-a11y flag.

rwp manifest --infer-a11y publication.epub  | jq .metadata.accessibility
Inferred metadata
Key Value Inferred?
accessMode auditory If the publication contains a reference to an audio or video resource (inspect resources and readingOrder in RWPM)
accessMode visual If the publications contains a reference to an image or a video resource (inspect resources and readingOrder in RWPM)
accessModeSufficient textual If the publication is partially or fully accessible (WCAG A or above)
Or if the publication does not contain any image, audio or video resource (inspect "resources" and "readingOrder" in RWPM)
Or if the only image available can be identified as a cover
feature displayTransformability If the publication is fully accessible (WCAG AA or above)
:warning: This property should only be inferred for reflowable EPUB files as it doesn't apply to other formats (FXL, PDF, audiobooks, CBZ/CBR).
feature printPageNumbers If the publications contains a page list (check for the presence of a pageList collection in RWPM)
feature tableOfContents If the publications contains a table of contents (check for the presence of a toc collection in RWPM)
feature MathML If the publication contains any resource with MathML (check for the presence of the contains property where the value is mathml in readingOrder or resources in RWPM)
feature synchronizedAudioText If the publication contains any reference to Media Overlays (TBD in RWPM)