Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mis-formatting of usage section for < S3 method #2066

Closed
ms609 opened this issue Mar 28, 2022 · 4 comments
Closed

Mis-formatting of usage section for < S3 method #2066

ms609 opened this issue Mar 28, 2022 · 4 comments
Labels
bug an unexpected problem or unintended behavior rd-translation 🎏
Milestone

Comments

@ms609
Copy link

ms609 commented Mar 28, 2022

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.

@dmurdoch
Copy link
Contributor

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.

@hadley
Copy link
Member

hadley commented Apr 21, 2022

Also ==(e1, e2)

@hadley hadley added bug an unexpected problem or unintended behavior rd-translation 🎏 labels May 31, 2022
@hadley hadley added this to the 2.1.0 milestone Apr 17, 2024
@hadley
Copy link
Member

hadley commented Apr 19, 2024

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

@hadley
Copy link
Member

hadley commented Apr 22, 2024

Yeah, definitely the same.

@hadley hadley closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior rd-translation 🎏
Projects
None yet
Development

No branches or pull requests

3 participants