roxygen2 icon indicating copy to clipboard operation
roxygen2 copied to clipboard

Autolinking with markdown functions does not produce the correct .Rd

Open olivroy opened this issue 5 months ago • 0 comments

On the website, it implies that [geom_point()][ggplot2::geom_point()] will link it as code.

however, with roxygen2 7.3.0, here is what I get with Roxygen: list(markdown= TRUE)

In short, according to the docs, I would expect.

#' [geom_point()][ggplot2::geom_point()]

\code{\link[ggplot2:geom_tile]{geom_tile()}}, but it does \link[ggplot2:geom_point]{geom_point()} instead.

Contrary to what the docs say, I actually need to use back ticks.

#' [`geom_point()`][ggplot2::geom_point()]

gives the correct result.

Side note:

I tried following the advice in SUPPORT.md, but roc_proc_text() does not appear to support markdown input?

library(roxygen2)
roc_proc_text(rd_roclet(), "
  #' Title
  #' 
  #' [geom_point()][ggplot2::geom_point()]
  #'
  #' [`geom_point()`][ggplot2::geom_point()]
  #' @export
  foo <- function() {}
  "
)
#> $foo.Rd
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in ./<text>
#> \name{foo}
#> \alias{foo}
#> \title{Title}
#> \usage{
#> foo()
#> }
#> \description{
#> [geom_point()][ggplot2::geom_point()]
#> }
#> \details{
#> [`geom_point()`][ggplot2::geom_point()]
#> }

Created on 2024-01-22 with reprex v2.1.0

olivroy avatar Jan 22 '24 22:01 olivroy