Skip to content

Commit

Permalink
Merge pull request #22 from cite-architecture/dev
Browse files Browse the repository at this point in the history
Export recoded `image_directory` function
  • Loading branch information
neelsmith authored Nov 22, 2021
2 parents f00f116 + d1fd2ce commit 0930355
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CitableImage"
uuid = "17ccb2e5-db19-44b3-b354-4fd16d92c74e"
authors = ["Neel Smith <dnsmith.neel@gmail.com>"]
version = "0.3.0"
version = "0.4.0"

[deps]
CitableBase = "d6f014bd-995c-41bd-9893-703339864534"
Expand Down
28 changes: 26 additions & 2 deletions docs/src/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ iifrequest = url(img, service)
Format the request for inclusion in a markdown document. Here, we'll use the optional height parameter to set the result image's size in pixels.

```@example eg
markdownImage(img, service, 200)
markdownImage(img, service; ht = 200)
```
```@eval
using CitableImage
Expand All @@ -43,7 +43,7 @@ using CitableObject
img = Cite2Urn("urn:cite2:hmt:vaimg.2017a:VA012RN_0013")
using Markdown
Markdown.parse(markdownImage(img, service, 200))
Markdown.parse(markdownImage(img, service; ht = 200))
```

## Compose a markdown display linked to an image citation tool
Expand All @@ -70,4 +70,28 @@ img = Cite2Urn("urn:cite2:hmt:vaimg.2017a:VA012RN_0013")
ict = "http://www.homermultitext.org/ict2/?"
using Markdown
Markdown.parse(linkedMarkdownImage(ict, img, service; ht=100, caption="folio 12 recto"))
```




## Compose an HTML display of an image

Format the request for inclusion in an HTML document. Here, we'll use the optional height parameter to set the result image's size in pixels.

```@example eg
htmlImage(img, service; ht = 200)
```


```@eval
using CitableImage
baseurl = "http://www.homermultitext.org/iipsrv"
root = "/project/homer/pyramidal/deepzoom"
service = IIIFservice(baseurl, root)
using CitableObject
img = Cite2Urn("urn:cite2:hmt:vaimg.2017a:VA012RN_0013")
HTML(htmlImage(img, service; ht = 200))
```
2 changes: 1 addition & 1 deletion src/CitableImage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export IIIFservice
export image_directory
export url, markdownImage, linkedMarkdownImage
export htmlImage, linkedHtmlImage
export image_directory


include("iiif.jl")
Expand Down
3 changes: 2 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
$(SIGNATURES)
"""
function image_directory(urn::Cite2Urn)
namespace(urn) * "/" * join(parts(collectioncomponent(urn)), "/")
collpath = joinpath(parts(collectioncomponent(urn))...)
joinpath(namespace(urn), collpath)
end


Expand Down

0 comments on commit 0930355

Please sign in to comment.