pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

Mis-formatting of usage section for `<` S3 method

Open ms609 opened this issue 2 years ago • 2 comments

I am creating package documentation using roxygen 7.1.2 & pkgdown 2.0.2.

My functions are written as

#' Sort some objects
#' @param x,decreasing,na.last,\dots As in [`sort()`].
#' @export
sort.multiPhylo <- function(x, decreasing = FALSE, na.last = NA, ...) {
  x # Function body goes here...
}

#' @rdname sort.multiPhylo
#' @export
`<.phylo` <- function(e1, e2) {
  TRUE # Function body goes here...
}

The documentation in R is rendered as expected:

## S3 method for class 'multiPhylo'
sort(x, decreasing = FALSE, na.last = NA, ...)

## S3 method for class 'phylo'
e1 < e2

But the pkgdown site yields:

# S3 method for multiPhylo
sort(x, decreasing = FALSE, na.last = NA, ...)

# S3 method for phylo
&lt;(e1, e2)

Note the html-encoding of < and the arrangement of the function as <(e1, e2) instead of e1 < e2.

ms609 avatar Mar 28 '22 10:03 ms609

I misunderstood this on first reading, so I'll clear it up for others: The source of the page contains

&amp;lt;(e1, e2)

so it renders as shown above.

dmurdoch avatar Mar 28 '22 10:03 dmurdoch

Also ==(e1, e2)

hadley avatar Apr 21 '22 13:04 hadley

Probably the same as #2303 (but this issue is about S3, not S4)

hadley avatar Apr 19 '24 20:04 hadley

Yeah, definitely the same.

hadley avatar Apr 22 '24 21:04 hadley