diff --git a/R/rd-family.R b/R/rd-family.R index 3b93013a..d3304a71 100644 --- a/R/rd-family.R +++ b/R/rd-family.R @@ -51,12 +51,15 @@ topics_process_family <- function(topics, env) { if (length(others) < 1) next - by_file <- map_chr(aliases[others], function(x) { + other_aliases <- aliases[others] + other_aliases_order <- map_chr(other_aliases, function(x) escape(x[1])) + + by_file <- map_chr(other_aliases[order(other_aliases_order)], function(x) { obj <- find_object(x[1], env) suffix <- if (is.function(obj$value)) "()" else "" paste0("\\code{\\link{", escape(x[1]), "}", suffix, "}") }) - links <- paste(sort_c(by_file), collapse = ",\n") + links <- paste(by_file, collapse = ",\n") seealso <- topics_process_family_prefix(family) topic$add(rd_section("seealso", paste0(seealso, "\n", links))) diff --git a/tests/testthat/_snaps/rd-family.md b/tests/testthat/_snaps/rd-family.md index 9206c3ff..0ed6fc38 100644 --- a/tests/testthat/_snaps/rd-family.md +++ b/tests/testthat/_snaps/rd-family.md @@ -16,8 +16,8 @@ } \seealso{ Other a: - \code{\link{foo2}()}, - \code{\link{foo}()} + \code{\link{foo}()}, + \code{\link{foo2}()} } \concept{a}