readium / r2-shared-js

Shared models for Readium Desktop
BSD 3-Clause "New" or "Revised" License
11 stars 12 forks source link

direction vs. readingProgression #3

Closed danielweck closed 5 years ago

danielweck commented 5 years ago

CC @jccr @HadrienGardeur

This issue is similar to spine vs. readingOrder.

In publication metadata, direction should be renamed to readingProgression: https://github.com/readium/r2-shared-js/blob/70f65cb5834fa9f2d3497f532997269dad6a2951/src/models/metadata.ts#L108 ( https://github.com/readium/r2-shared-js/blob/develop/src/models/metadata.ts#L108 )

JSON Schema: https://github.com/readium/webpub-manifest/blob/d0b5694e662faf88262a3dc6a50ca32220fc825a/schema/metadata.schema.json#L120 ( https://github.com/readium/webpub-manifest/blob/master/schema/metadata.schema.json#L120 )

Existing client implementations that parse the JSON property name directly (rather than using the in-memory data model) will need to update their code to support both the legacy direction term, as well as readingProgression (as we did when switching from spine to readingOrder).

danielweck commented 5 years ago

spine vs. readingOrder (this change required updating EPUBjs, NYPL reader, and various other reading systems):

https://github.com/readium/r2-shared-js/blob/70f65cb5834fa9f2d3497f532997269dad6a2951/src/models/publication.ts#L42-L44 ( https://github.com/readium/r2-shared-js/blob/develop/src/models/publication.ts#L42-L44 )

danielweck commented 5 years ago

Developer sticky note: the r2-navigator-js layout/rendering engine uses the already-parsed in-memory data model, does not access the JSON property directly (so no change required): https://github.com/readium/r2-navigator-js/blob/develop/src/electron/renderer/index.ts

danielweck commented 5 years ago

Done: https://github.com/readium/r2-shared-js/blob/b474cfc1c27ac8d280313a8e9357d7bcbf2ba869/src/models/metadata.ts#L205