@@ -14,6 +14,7 @@ print.geolocatordp <- function(x, ...) {
1414 # check_geolocatordp() not necessary: print only triggered for geolocatordp object
1515
1616 check_gldp(x )
17+ x <- update_gldp_order_resources(x )
1718
1819 has_value <- function (value ) ! is.null(value ) && length(value ) > 0
1920 format_creator_name <- function (name ) {
@@ -58,13 +59,13 @@ print.geolocatordp <- function(x, ...) {
5859 contributors <- sapply(x_display $ contributors , \(ctr ) {
5960 str <- format_creator_name(ctr $ title )
6061 if (has_value(ctr $ email )) {
61- str <- paste0( str , " (' " , ctr $ email , " ')" )
62+ str <- glue :: glue( " { str} ('{ ctr$email} ')" )
6263 }
6364 if (has_value(ctr $ roles )) {
64- str <- paste0( str , " ( " , paste (ctr $ roles , collapse = " , " ), " )" )
65+ str <- glue :: glue( " { str} ({glue::glue_collapse (ctr$roles, sep = ', ')} )" )
6566 }
6667 if (has_value(ctr $ path )) {
67- str <- paste0( str , " - {.url " , ctr $ path , " }" )
68+ str <- glue :: glue( " { str} - {{ .url { ctr$path}} }" )
6869 }
6970 str
7071 })
@@ -87,27 +88,27 @@ print.geolocatordp <- function(x, ...) {
8788 if (has_value(license $ title )) {
8889 str <- license $ title
8990 if (has_value(license $ name )) {
90- str <- paste0( str , " ( " , license $ name , " )" )
91+ str <- glue :: glue( " { str} ({ license$name} )" )
9192 }
9293 } else {
9394 str <- license $ name
9495 }
9596 if (has_value(license $ path )) {
96- str <- paste0( str , " - {.url " , license $ path , " }" )
97+ str <- glue :: glue( " { str} - {{ .url { license$path}} }" )
9798 }
9899 str
99100 })
100101 licenses <- licenses [nzchar(licenses )]
101102 if (length(licenses ) > 0 ) {
102- cli_bullets(c(" *" = " {.field licenses}: {paste (licenses, collapse = ', ')}" ))
103+ cli_bullets(c(" *" = " {.field licenses}: {glue::glue_collapse (licenses, sep = ', ')}" ))
103104 }
104105 }
105106
106107 if (has_value(x_display $ description )) {
107108 desc <- as.character(x_display $ description )[1 ]
108109 max_chars <- 250L
109110 if (! is.na(desc ) && nchar(desc ) > max_chars ) {
110- desc <- paste0( substr(desc , 1 , max_chars ), " ..." )
111+ desc <- glue :: glue( " { substr(desc, 1, max_chars)} ..." )
111112 }
112113 cli_bullets(c(" *" = " {.field description}: {.val {desc}}" ))
113114 }
@@ -119,9 +120,9 @@ print.geolocatordp <- function(x, ...) {
119120 toupper(ri $ relatedIdentifierType %|| % " " ) == " DOI" &&
120121 ! grepl(" ^https?://" , ri $ relatedIdentifier )
121122 ) {
122- ri $ relatedIdentifier <- paste0 (" https://doi.org/" , ri $ relatedIdentifier )
123+ ri $ relatedIdentifier <- glue :: glue (" https://doi.org/{ ri$relatedIdentifier} " )
123124 }
124- paste0( ri $ relationType , " { .url " , ri $ relatedIdentifier , " }" )
125+ glue :: glue( " { ri$relationType} {{ .url { ri$relatedIdentifier}} }" )
125126 })
126127 cli_bullets(c(" *" = " {.field relatedIdentifiers}:" ))
127128 for (ri in ris ) {
0 commit comments