Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IIIF validation #45

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

IIIF validation #45

wants to merge 5 commits into from

Conversation

camdendotlol
Copy link
Collaborator

@camdendotlol camdendotlol commented Nov 15, 2024

Summary

  • adds a bunch of checking for null values and array length throughout the iiif.js script to make sure we're getting the data we need to properly generate the TEI file
    • some of these checks address potential crashes (e.g. accessing the first element of an array that might be empty) while others focus more on user error (e.g. undefined labels and empty item arrays)
  • adds newlines and indentation between each surface element so they're no longer all printed on one line
  • updates the TEI template used by the iiif script to wrap the contents in a div

Notes

We have to be really careful here because there's so much variation in how IIIF manifests can look - we don't want to error out on a valid manifest. So this PR takes a pretty minimalist approach to these checks and doesn't attempt to fully validate the manifest against the IIIF standard. I've tested with a wide range of manifests with both versions of the Presentation API and they all worked, but it might be worth testing more widely before a production release.

@camdendotlol camdendotlol marked this pull request as ready for review November 18, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant