Overview

This is a note about adding pagination support to the DTS (Distributed Text Services) viewer.

https://dts-viewer.vercel.app/ja/

Background

When providing a large number of resources through DTS, it appears that the view property is used to present pagination information, as shown below.

https://distributed-text-services.github.io/specifications/versions/unstable/#collection-endpoint

{
    "@context": "https://distributed-text-services.github.io/specifications/context/1-alpha1.json",
    "dtsVersion": "1-alpha",
    "@id" : "lettres_de_poilus",
    "@type" : "Collection",
    "collection": "/api/dts/collection/{?id,page,nav}",
    "totalParents": 1,
    "totalChildren": 10000,
    "title": "Lettres de Poilus",
    "dublinCore": {
        "publisher": ["École Nationale des Chartes", "https://viaf.org/viaf/167874585"],
        "title": [
            {"lang": "fr", "value" : "Lettres de Poilus"}
        ]
    },
    "member": [
      "..."
    ],
    "view": {
        "@id": "/api/dts/collection/?id=lettres_de_poilus&page=19",
        "@type": "Pagination",
        "first": "/api/dts/collection/?id=lettres_de_poilus&page=1",
        "previous": "/api/dts/collection/?id=lettres_de_poilus&page=18",
        "next": "/api/dts/collection/?id=lettres_de_poilus&page=20",
        "last": "/api/dts/collection/?id=lettres_de_poilus&page=500"
    }
}

I updated the DTS Viewer to support the view property described above.

Display Example

When a collection has the view property, pagination buttons are now displayed as shown below.

Summary

I hope this serves as a helpful reference for distributing digital text collections using the DTS (Distributed Text Services) API.