You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/api/webanno.rs
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -154,8 +154,8 @@ pub struct WebAnnoConfig {
154
154
155
155
/// Adds an extra targets alongside the usual target with TextPositionSelector. This can
156
156
/// be used for provide a direct URL to fetch the exact textselection (if the backend system supports it).
157
-
/// In the template, you should use the variables {resource} (which is the resource IRI), {begin}, and {end} , they will be substituted accordingly.
158
-
/// A common value is {resource}/{begin}/{end} .
157
+
/// In the template, you should use the variables {resource_iri} (which is the resource IRI) or {resource} (which is the ID), {begin}, and {end} , they will be substituted accordingly.
158
+
/// A common value is {resource_iri}/{begin}/{end} or https://example.com/{resource}/{begin}/{end}.
159
159
pubextra_target_templates:Vec<String>,
160
160
161
161
/// Do not output @context (useful if already done at an earlier stage)
@@ -517,12 +517,14 @@ fn output_selector(
517
517
for extra_target_template in config.extra_target_templates.iter(){
518
518
letmut template = extra_target_template.clone();
519
519
template = template.replace(
520
-
"{resource}",
520
+
"{resource_iri}",
521
521
&into_iri(
522
522
resource.id().expect("resource must have ID"),
523
523
&config.default_resource_iri,
524
524
),
525
525
);
526
+
template = template
527
+
.replace("{resource}", resource.id().expect("resource must have ID"));
0 commit comments