CiteDown.jl

TL;DR

Write markdown text with links to citable content identified by URN; configure sources for retrieving citable content in a YAML header; resolve URN values to content referred to by URLs.

What it is

Markdown is a light-weight, practical format for expressing the structure of textual content. Cite2Urns and CtsUrns are technology-independent formats for identifying scholarly resources. The CiteDown.jl package lets you identify linked content in markdown documents with URNs. You can separately configure sources for resolving the URNs and linking to or embedding content cited by URN in a new, resolved markdown document.

In version 0.1.x, the CiteDown package supports the use of Cite2Urns to cite images.

Citation of images in markdown

URNs may be used in image references, to embed an image in the document, or in generic links.

Here's a markdown example of an image reference (image would be embedded on the page in markdown-aware applications):

The first page of the *Iliad*:  

![illustration](urn:cite2:hmt:vaimg.2017a:VA012RN_0013)

Here's a markdown example of a generic link (image would be treated as a hyperlink in markdown-aware applications):

[this page](urn:cite2:hmt:vaimg.2017a:VA012RN_0013)

Image URNs may include extended citation to identify a region of interest on the image, as in this markdown example:

A one-line summary of the first book appears in 
[this image](urn:cite2:hmt:vaimg.2017a:VA012RN_0013@0.1554,0.09733,0.3975,0.02652).  

Here it is embedded in the current page:

![detail](urn:cite2:hmt:vaimg.2017a:VA012RN_0013@0.1554,0.09733,0.3975,0.02652)

Configuring a YAML header

Example:

---
ict: "http://www.homermultitext.org/ict2/?"  
iiif:
    service: "http://www.homermultitext.org/iipsrv"
    path: "/project/homer/pyramidal/deepzoom"
maxheight: 500
---

Generating new markdown resolved to URL values

The rewrite function takes a file name, and composes a new markdown string. Compare the source file with the rewritten version.

Source:

mdfile = joinpath(repository, "test", "data", "img.md")
read(mdfile, String) |> print
---
ict: "http://www.homermultitext.org/ict2/?"
iiif:
    service: "http://www.homermultitext.org/iipsrv"
    path: "/project/homer/pyramidal/deepzoom"
maxheight: 500
---

Contents of Markdown file.

Venetus A, page 1 recto:

 ![1 recto](urn:cite2:hmt:vaimg.2017a:VA001RN_0002)


Separate ink with title

![title](urn:cite2:hmt:vaimg.2017a:VA001RN_0002@0.1639,0.1667,0.4738,0.04948)

Rewritten:

using CiteDown
withurls = rewrite(mdfile)
print(withurls)
Contents of Markdown file.

Venetus A, page 1 recto:

![1 recto]([![image)](http://www.homermultitext.org/iipsrv?IIIF=/project/homer/pyramidal/deepzoom/hmt/vaimg/2017a/VA001RN_0002.tif/full/500,/0/default.jpg)](http://www.homermultitext.org/ict2/?urn=urn:cite2:hmt:vaimg.2017a:VA001RN_0002))

Separate ink with title

![title]([![image)](http://www.homermultitext.org/iipsrv?IIIF=/project/homer/pyramidal/deepzoom/hmt/vaimg/2017a/VA001RN_0002.tif/pct:16.39,16.67,47.38,4.948/500,/0/default.jpg)](http://www.homermultitext.org/ict2/?urn=urn:cite2:hmt:vaimg.2017a:VA001RN_0002@0.1639,0.1667,0.4738,0.04948))