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

Update recipes to use a base_url variable to improve readability #183

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

digitaldogsbody
Copy link
Member

Picking up on an idea I used during my dogfooding of the "Introduction to iiif-prezi3" lightning talk: due to the structure of the recipes, there are a lot of id fields that have a common start, so this PR adds a base_url variable and uses it in the various bits of manifest data, meaning that the resulting code looks a bit less cluttered (IMO)

@digitaldogsbody digitaldogsbody requested review from glenrobson and a team June 10, 2023 14:44
Copy link
Contributor

@glenrobson glenrobson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The base URL is made up of a standard URL plus a recipe identifier so you could generate it like:

recipeId="0001-mvm-image"
base_url = f"https://iiif.io/api/cookbook/recipe/{recipeId}"

but looking through the code you only reference it once so probably not worth it.

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.

2 participants