-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from iiif-prezi/recipe_updates
Update recipes to use a `base_url` variable to improve readability
- Loading branch information
Showing
26 changed files
with
197 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
from iiif_prezi3 import Manifest, AnnotationPage, Annotation, ResourceItem, config | ||
|
||
config.configs['helpers.auto_fields.AutoLang'].auto_lang = "en" | ||
base_url = "https://iiif.io/api/cookbook/recipe/0002-mvm-audio" | ||
|
||
manifest = Manifest(id="https://iiif.io/api/cookbook/recipe/0002-mvm-audio/manifest.json", label="Simplest Audio Example 1") | ||
canvas = manifest.make_canvas(id="https://iiif.io/api/cookbook/recipe/0002-mvm-audio/canvas", duration=1985.024) | ||
manifest = Manifest(id=f"{base_url}/manifest.json", label="Simplest Audio Example 1") | ||
canvas = manifest.make_canvas(id=f"{base_url}/canvas", duration=1985.024) | ||
anno_body = ResourceItem(id="https://fixtures.iiif.io/audio/indiana/mahler-symphony-3/CD1/medium/128Kbps.mp4", | ||
type="Sound", | ||
format="audio/mp4", | ||
duration=1985.024) | ||
anno_page = AnnotationPage(id="https://iiif.io/api/cookbook/recipe/0002-mvm-audio/canvas/page") | ||
anno = Annotation(id="https://iiif.io/api/cookbook/recipe/0002-mvm-audio/canvas/page/annotation", | ||
anno_page = AnnotationPage(id=f"{base_url}/canvas/page") | ||
anno = Annotation(id=f"{base_url}/canvas/page/annotation", | ||
motivation="painting", | ||
body=anno_body, | ||
target=canvas.id) | ||
anno_page.add_item(anno) | ||
canvas.add_item(anno_page) | ||
|
||
print(manifest.json(indent=2)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
from iiif_prezi3 import Manifest, config | ||
|
||
config.configs['helpers.auto_fields.AutoLang'].auto_lang = "en" | ||
base_url = "https://iiif.io/api/cookbook/recipe/0005-image-service" | ||
|
||
manifest = Manifest(id="https://iiif.io/api/cookbook/recipe/0005-image-service/manifest.json", label="Picture of Göttingen taken during the 2019 IIIF Conference") | ||
manifest = Manifest(id=f"{base_url}/manifest.json", label="Picture of Göttingen taken during the 2019 IIIF Conference") | ||
canvas = manifest.make_canvas_from_iiif(url="https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen", | ||
id="https://iiif.io/api/cookbook/recipe/0005-image-service/canvas/p1", | ||
id=f"{base_url}/canvas/p1", | ||
label="Canvas with a single IIIF image", | ||
anno_id="https://iiif.io/api/cookbook/recipe/0005-image-service/annotation/p0001-image", | ||
anno_page_id="https://iiif.io/api/cookbook/recipe/0005-image-service/page/p1/1") | ||
anno_id=f"{base_url}/annotation/p0001-image", | ||
anno_page_id=f"{base_url}/page/p1/1") | ||
|
||
print(manifest.json(indent=2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
from iiif_prezi3 import Manifest, KeyValueString, config | ||
|
||
config.configs['helpers.auto_fields.AutoLang'].auto_lang = "en" | ||
base_url = "https://iiif.io/api/cookbook/recipe/0007-string-formats" | ||
|
||
manifest = Manifest(id="https://iiif.io/api/cookbook/recipe/0007-string-formats/manifest.json", | ||
manifest = Manifest(id=f"{base_url}/manifest.json", | ||
label="Picture of Göttingen taken during the 2019 IIIF Conference", | ||
summary="<p>Picture taken by the <a href=\"https://github.com/glenrobson\">IIIF Technical Coordinator</a></p>", | ||
rights="http://creativecommons.org/licenses/by-sa/3.0/", | ||
requiredStatement=KeyValueString(label="Attribution", | ||
value="<span>Glen Robson, IIIF Technical Coordinator. <a href=\"https://creativecommons.org/licenses/by-sa/3.0\">CC BY-SA 3.0</a> <img src=\"https://licensebuttons.net/l/by-sa/3.0/88x31.png\"/></span>"), | ||
metadata=[KeyValueString(label="Author", value={"none": ["<span><a href='https://github.com/glenrobson'>Glen Robson</a></span>"]})]) | ||
canvas = manifest.make_canvas_from_iiif(url="https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen", | ||
id="https://iiif.io/api/cookbook/recipe/0007-string-formats/canvas/p1", | ||
anno_id="https://iiif.io/api/cookbook/recipe/0007-string-formats/annotation/p0001-image", | ||
anno_page_id="https://iiif.io/api/cookbook/recipe/0007-string-formats/page/p1/1") | ||
id=f"{base_url}/canvas/p1", | ||
anno_id=f"{base_url}/annotation/p0001-image", | ||
anno_page_id=f"{base_url}/page/p1/1") | ||
|
||
print(manifest.json(indent=2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
from iiif_prezi3 import Manifest, config | ||
|
||
config.configs['helpers.auto_fields.AutoLang'].auto_lang = "en" | ||
base_url = "https://iiif.io/api/cookbook/recipe/0009-book-1" | ||
|
||
manifest = Manifest(id="https://iiif.io/api/cookbook/recipe/0009-book-1/manifest.json", | ||
manifest = Manifest(id=f"{base_url}/manifest.json", | ||
label="Simple Manifest - Book", | ||
behavior=["paged"]) | ||
canvas1 = manifest.make_canvas_from_iiif(url="https://iiif.io/api/image/3.0/example/reference/59d09e6773341f28ea166e9f3c1e674f-gallica_ark_12148_bpt6k1526005v_f18", | ||
id="https://iiif.io/api/cookbook/recipe/0009-book-1/canvas/p1", | ||
id=f"{base_url}/canvas/p1", | ||
label="Blank page", | ||
anno_id="https://iiif.io/api/cookbook/recipe/0009-book-1/annotation/p0001-image", | ||
anno_page_id="https://iiif.io/api/cookbook/recipe/0009-book-1/page/p1/1") | ||
anno_id=f"{base_url}/annotation/p0001-image", | ||
anno_page_id=f"{base_url}/page/p1/1") | ||
|
||
canvas2 = manifest.make_canvas_from_iiif(url="https://iiif.io/api/image/3.0/example/reference/59d09e6773341f28ea166e9f3c1e674f-gallica_ark_12148_bpt6k1526005v_f19", | ||
id="https://iiif.io/api/cookbook/recipe/0009-book-1/canvas/p2", | ||
id=f"{base_url}/canvas/p2", | ||
label="Frontispiece", | ||
anno_id="https://iiif.io/api/cookbook/recipe/0009-book-1/annotation/p0002-image", | ||
anno_page_id="https://iiif.io/api/cookbook/recipe/0009-book-1/page/p2/1") | ||
anno_id=f"{base_url}/annotation/p0002-image", | ||
anno_page_id=f"{base_url}/page/p2/1") | ||
|
||
canvas3 = manifest.make_canvas_from_iiif(url="https://iiif.io/api/image/3.0/example/reference/59d09e6773341f28ea166e9f3c1e674f-gallica_ark_12148_bpt6k1526005v_f20", | ||
id="https://iiif.io/api/cookbook/recipe/0009-book-1/canvas/p3", | ||
id=f"{base_url}/canvas/p3", | ||
label="Title page", | ||
anno_id="https://iiif.io/api/cookbook/recipe/0009-book-1/annotation/p0003-image", | ||
anno_page_id="https://iiif.io/api/cookbook/recipe/0009-book-1/page/p3/1") | ||
anno_id=f"{base_url}/annotation/p0003-image", | ||
anno_page_id=f"{base_url}/page/p3/1") | ||
|
||
canvas4 = manifest.make_canvas_from_iiif(url="https://iiif.io/api/image/3.0/example/reference/59d09e6773341f28ea166e9f3c1e674f-gallica_ark_12148_bpt6k1526005v_f21", | ||
id="https://iiif.io/api/cookbook/recipe/0009-book-1/canvas/p4", | ||
id=f"{base_url}/canvas/p4", | ||
label="Blank page", | ||
anno_id="https://iiif.io/api/cookbook/recipe/0009-book-1/annotation/p0004-image", | ||
anno_page_id="https://iiif.io/api/cookbook/recipe/0009-book-1/page/p4/1") | ||
anno_id=f"{base_url}/annotation/p0004-image", | ||
anno_page_id=f"{base_url}/page/p4/1") | ||
|
||
canvas5 = manifest.make_canvas_from_iiif(url="https://iiif.io/api/image/3.0/example/reference/59d09e6773341f28ea166e9f3c1e674f-gallica_ark_12148_bpt6k1526005v_f22", | ||
id="https://iiif.io/api/cookbook/recipe/0009-book-1/canvas/p5", | ||
id=f"{base_url}/canvas/p5", | ||
label="Bookplate", | ||
anno_id="https://iiif.io/api/cookbook/recipe/0009-book-1/annotation/p0005-image", | ||
anno_page_id="https://iiif.io/api/cookbook/recipe/0009-book-1/page/p5/1") | ||
anno_id=f"{base_url}/annotation/p0005-image", | ||
anno_page_id=f"{base_url}/page/p5/1") | ||
|
||
print(manifest.json(indent=2)) |
Oops, something went wrong.