readium / webpub-manifest

📜 A JSON based Web Publication Manifest format used at the core of the Readium project
BSD 3-Clause "New" or "Revised" License
91 stars 23 forks source link

Review our support for the W3C Publication Manifest #37

Open HadrienGardeur opened 4 years ago

HadrienGardeur commented 4 years ago

Moving forward, we should expect various projects tied to the Readium Architecture to support the W3C Publication Manifest: https://w3c.github.io/pub-manifest/

This Epic is meant to cover all known issues with parsing and representing a W3C Publication Manifest with RWPM as an internal data structure.

HadrienGardeur commented 4 years ago

Aside from the various issues that I've linked to the epic, there's a major problem that we'll have to deal with regarding resources and readingOrder: the media type (type in RWPM, encodingFormat in W3C Publication Manifest) is optional for the W3C manifest but required for RWPM.

In the context of a packaged publication, we can easily take a look at resources and figure out their media type. But over HTTP this is much more difficult and would require a GET or HEAD request per ressource.

An alternate take on this would be to simply parse the W3C manifest as-is, without any attempt to figure out the media type if it's not specified. Since this would return an invalid RWPM that will trigger errors when checked against our JSON Schema, I'm not really in favor of that option.

Any thoughts on this? cc @danielweck @llemeurfr