A Resource Container (RC) link allows one RC to reference content from another RC.
All RC links follow a very simple structure in two different flavors.
The minimum form of a link is
We interpret this as the project content directory inside the RC.
This is illustrated below:
# file system
|-content/ <-- link points here
From this point we can lengthen the link to include a chapter Slug which resolves to the chapter directory.
# file system
|-01/ <-- link points here
Going a step further we can link to a specific chunk
# file system
|-01.usfm <-- link points here
In some of the examples above the link was not pointing directly at a file.
In those cases the link should resolve to the first available file in order of the sorting priority described in Content Sort Order.
You may link to online media by simply using a url instead of an RC identifier.
Links where the path begins with
https:// are treated as external urls.
In certain cases it is appropriate to abbreviate a link.
Below are a list of cases where you are allowed to use an abbreviation.
Links within the same RC
When linking to a different section within the same RC you may just provide the chapter/chunk Slug s.
Links to any language
At times you may not wish to restrict the link to a particular language of the RC.
In that case you may exclude the language code from the beginning of the path and place an extra slash
/ in it’s place.
A short link is used to reference a resource but not a project.
There is nothing fundamentally different from regular links. Short links are simply composed of just the language and resource.
Short links are most often used within the Manifest File when referring to related resources.
Automatically Linking Bible References
Bible references in any RC should be automatically converted into resolvable links according to the linking rules for book resource types.
Of course, if the reference is already a link nothing needs to be done.
Conversion of biblical references are limited to those resources that have been indexed on the users’ device.
Conversion should be performed based on any one of the following:
- a case insensitive match of the entire project title.
- a start case (first letter is uppercase) match of the project Slug e.g.
For each case above there must be a valid
chapter:verse reference immediately after the matching word separated a single white space.
The chapter and verse numbers should be converted to properly formatted Slug s.
Given the French reference below:
If the user has only downloaded the English resource the link will not resolve because the title
genesis does not match
Neither does the camel case Slug
Gen match since it does not match the entire word.
If the user now downloads the French resource the link will resolve because
genèse does indeed match
The result will be:
When a match occurs there may be several different resources that could be used in the link such as
When more than one resource Slug is available use the following rules in order until a unique match is found:
- use the same resource as indicated by the application context.
- use the RC allowed by the translate_mode set in the application.
- choose the first resource found or let the user choose (e.g. pop up).
Aligning Verses to Chunks
Because chunks may contain a range of verses, a passage reference may not exactly match up to a chunk.
Therefore some interpolation may be nessesary. For both chapter and verse numbers perform the follow:
Given a chapter or verse number
And an equivalent sorted list
list of chapters or verses in the matched resource
- incrementally compare the key against items in the list.
- if the integer value of the current list item is less than the key: continue.
- if the integer value of the current list item is greater than the key: use the previous list item.
- if the end of the list is reached: use the previous list item.
For example chunk
01 may contain verses
1-3 whereas chunk
02 contains verses
2 would resolve to chunk
If no chapter or chunk can be found to satisfy the reference it should not be converted to a link.