From 5ecbc9001e03a1b455a1972bbcac2bb2b7277beb Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Mar 2026 22:47:38 +0000 Subject: [PATCH] Fix {.topic} to use required pkg::topic format with display text {.topic} in cli requires a package-qualified topic reference to generate a valid x-r-help:pkg::topic URI. Bare {.topic AMR-options} produced a malformed x-r-help:AMR-options URI (no package prefix). Use the [display_text](pkg::topic) form throughout: {.topic [AMR-options](AMR::AMR-options)} {.topic [AMR-deprecated](AMR::AMR-deprecated)} The hyphen in the topic name is fine as a URI string even though AMR::AMR-options is not a valid R symbol expression. The fallback handler in format_message() already handles the [text](uri) form by extracting the display text, so plain-text output is unchanged. https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b --- R/count.R | 4 ++-- R/interpretive_rules.R | 2 +- R/proportion.R | 4 ++-- R/zz_deprecated.R | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/count.R b/R/count.R index 174c6f423..19bd6c74d 100755 --- a/R/count.R +++ b/R/count.R @@ -128,7 +128,7 @@ count_resistant <- function(..., # other arguments for meet_criteria are handled by sir_calc() meet_criteria(guideline, allow_class = "character", is_in = c("EUCAST", "CLSI"), has_length = 1) if (is.null(getOption("AMR_guideline")) && missing(guideline) && message_not_thrown_before("count_resistant", "eucast_default", entire_session = TRUE)) { - message_("{.help [{.fun count_resistant}](AMR::count_resistant)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic AMR-options}.") + message_("{.help [{.fun count_resistant}](AMR::count_resistant)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic [AMR-options](AMR::AMR-options)}.") message_("This message will be shown once per session.") } tryCatch( @@ -152,7 +152,7 @@ count_susceptible <- function(..., # other arguments for meet_criteria are handled by sir_calc() meet_criteria(guideline, allow_class = "character", is_in = c("EUCAST", "CLSI"), has_length = 1) if (is.null(getOption("AMR_guideline")) && missing(guideline) && message_not_thrown_before("count_susceptible", "eucast_default", entire_session = TRUE)) { - message_("{.help [{.fun count_susceptible}](AMR::count_susceptible)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic AMR-options}.") + message_("{.help [{.fun count_susceptible}](AMR::count_susceptible)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic [AMR-options](AMR::AMR-options)}.") message_("This message will be shown once per session.") } tryCatch( diff --git a/R/interpretive_rules.R b/R/interpretive_rules.R index dd0359888..947ae6e10 100755 --- a/R/interpretive_rules.R +++ b/R/interpretive_rules.R @@ -1097,7 +1097,7 @@ eucast_rules <- function(x, rules = getOption("AMR_interpretive_rules", default = c("breakpoints", "expected_phenotypes")), ...) { if (!is.null(getOption("AMR_eucastrules", default = NULL))) { - warning_("The global option {.code AMR_eucastrules} that you have set is now invalid was ignored - set {.code AMR_interpretive_rules} instead. See {.topic AMR-options}.") + warning_("The global option {.code AMR_eucastrules} that you have set is now invalid was ignored - set {.code AMR_interpretive_rules} instead. See {.topic [AMR-options](AMR::AMR-options)}.") } interpretive_rules(x = x, col_mo = col_mo, info = info, rules = rules, guideline = "EUCAST", ...) } diff --git a/R/proportion.R b/R/proportion.R index 35f0b210d..573430210 100644 --- a/R/proportion.R +++ b/R/proportion.R @@ -238,7 +238,7 @@ resistance <- function(..., # other arguments for meet_criteria are handled by sir_calc() meet_criteria(guideline, allow_class = "character", is_in = c("EUCAST", "CLSI"), has_length = 1) if (is.null(getOption("AMR_guideline")) && missing(guideline) && message_not_thrown_before("resistance", "eucast_default", entire_session = TRUE)) { - message_("{.help [{.fun resistance}](AMR::resistance)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic AMR-options}.") + message_("{.help [{.fun resistance}](AMR::resistance)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic [AMR-options](AMR::AMR-options)}.") message_("This message will be shown once per session.") } tryCatch( @@ -266,7 +266,7 @@ susceptibility <- function(..., # other arguments for meet_criteria are handled by sir_calc() meet_criteria(guideline, allow_class = "character", is_in = c("EUCAST", "CLSI"), has_length = 1) if (is.null(getOption("AMR_guideline")) && missing(guideline) && message_not_thrown_before("susceptibility", "eucast_default", entire_session = TRUE)) { - message_("{.help [{.fun susceptibility}](AMR::susceptibility)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic AMR-options}.") + message_("{.help [{.fun susceptibility}](AMR::susceptibility)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic [AMR-options](AMR::AMR-options)}.") message_("This message will be shown once per session.") } tryCatch( diff --git a/R/zz_deprecated.R b/R/zz_deprecated.R index 79701a32f..fb9b7c1dc 100755 --- a/R/zz_deprecated.R +++ b/R/zz_deprecated.R @@ -124,7 +124,7 @@ deprecation_warning <- function(old = NULL, new = NULL, fn = NULL, extra_msg = N ". The old name will be removed in future version, so please update your code.", ifelse(type == "argument", ". While the old argument still works, it will be removed in a future version, so please update your code.", - " and will be removed in a future version, see {.topic AMR-deprecated}." + " and will be removed in a future version, see {.topic [AMR-deprecated](AMR::AMR-deprecated)}." ) ), ifelse(!is.null(extra_msg),