pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

Is it possible to link objects showing up inside other-than-R preformatted text blocks?

Open ramiromagno opened this issue 3 years ago • 0 comments

Say I have Rf_ScalarLogical:

#' Rf_ScalarLogical
#'
#' A nice function indeed.
#'
#' @name Rf_ScalarLogical
NULL

and hello:

#' Hello
#'
#' @description
#' Just some random description.
#'
#' # C Examples
#'
#' ```C
#' // just some C code
#' int x = 2;
#' SEXP y;
#' y = PROTECT(Rf_ScalarLogical(x));
#' UNPROTECT(1);
#' return y;
#' ```
#'
#' # YAML examples
#' ``` yaml
#' url: https://pkgdown.r-lib.org
#' ```
#'
#' # Some other R examples
#' ```R
#' x <- sum(2) + Rf_ScalarLogical()
#' ```
#'
#' @examples
#' x <- sum(2) + Rf_ScalarLogical()
#'
hello <- function() {
  "hello!"
}

In a rendered website page, Rf_ScalarLogical is transformed to an hyperlink in both the ```R block and in block generated by @examples. Is it possible to make it also a link from within the C block?

snap

ramiromagno avatar Aug 08 '22 02:08 ramiromagno