readium / go-toolkit

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

Output an OPDS 2.0 feed listing publications #37

Closed HadrienGardeur closed 5 months ago

HadrienGardeur commented 7 years ago

While the current version of the Go streamer is focused on parsing and serving a single publication, the use case for both the Go and node.js/Typescript versions of the streamer might be primarily on the server side.

To better adapt to such use cases, we should do the following:

OPDS 2.0 is not truly a thing yet, aside from a few experiments on Gist.

But to reach a point where we're comfortable writing a specification for OPDS 2.0, we need to experiment and this is the perfect opportunity to do it.

Here are a few ground rules:

Here's a very basic example of what the output will look like:

{
  "@context": "http://opds-spec.org/opds.jsonld",

  "metadata": {
    "@type": "http://schema.org/DataFeed",
    "title": "All Publications",
    "numberOfItems": 1
  },

  "links": [
    {"rel": "self", "href": "http://example.org/publications.json", "type": "application/opds+json"}
  ],

  "publications": [
    {
      "metadata": {
        "@type": "http://schema.org/Book",
        "title": "Moby-Dick",
        "author": "Herman Melville",
        "identifier": "urn:isbn:978031600000X",
        "language": "en",
        "modified": "2015-09-29T17:00:00Z"
      },
      "links": [
        {"rel": "self", "href": "http://example.org/manifest.json", "type": "application/webpub+json"},
      ],     
      "images": [
        {"href": "http://example.org/cover.jpg", "type": "image/jpeg", "height": 600, "width": 400},
      ]
    }
  ]
}
HadrienGardeur commented 7 years ago

This is also relevant for the node.js/Typescript version cc @danielweck

I'm also interested in receiving feedback about the output from @aslagle or @leonardr

A few things that are different in OPDS 2.0 with the current proposal: