hypothesis / hypothesis/h

Review h for references to annotation selector types which need updating following addition of EPUBContentSelector and PageSelector selectors

Open
#7,803 0 comments 0 reactions 0 assignees View on GitHub
code health
Dominant language
Python
Stars
3.2k
Forks
459
Avg merge
27d 1h
Merged PRs (30d)
1

Description

As part of our overhauled EPUB support in the client, new selector types have been added. See the [`EPUBContentSelector` and `PageSelector`](https://github.com/hypothesis/client/blob/dd9ffa0285f7aca347b97929478d4a2dbbe0f1f8/src/types/api.ts#L75) definitions.

There are some references to the various selector types that the client uses in h:

- API documentation
- Web Annotations JSON-LD export

These new selectors are currently just returned in the JSON-LD version of an annotation unchanged, rather than mapped to some part of the Web Annotations spec.

The [Web Annotations data model](https://www.w3.org/TR/annotation-model/#fragment-selector) doesn't really have a good equivalent for these selectors. It does have examples of using FragmentSelector to indicate PDF pages and EPUB CFIs, so generating equivalent FragmentSelector(s) is one option. However those don't contain all the information of our selectors (eg. for EPUBContentSelector we include the chapter title and content document URL for added robustness to future content changes), and also has the nuisance of being stringly-typed. On the other hand, these fragment selectors are at least part of published specifications.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.