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

Documenting an object may corrupt Rd formatting #562

Closed
yutannihilation opened this issue Jan 17, 2017 · 1 comment
Closed

Documenting an object may corrupt Rd formatting #562

yutannihilation opened this issue Jan 17, 2017 · 1 comment
Labels

Comments

@yutannihilation
Copy link
Contributor

@yutannihilation yutannihilation commented Jan 17, 2017

I found that sfr is not formatted well by roxygen. (r-spatial/sf#177)

Here is a minimal replex R file in my repo for proof of concept:

#' Hello, world!
#'
#' This is an example function named 'hello'
#' which prints 'Hello, world!'.
#'
#' @name hello
# Exporting object seems not allowed.
hello <- "hello"

#' @rdname hello
#' @export
how_low <- function(x) UseMethod("how_low")

#' @rdname hello
#' @export
how_low.default <- function(x) "hello"

#' @rdname hello
#' @export
how_low.character <- function(x) "Nirvana"

This will result bellow with incorrect double backslashes:

\usage{
hello

how_low(x)

\\method{how_low}{default}(x)

\\method{how_low}{character}(x)
}

I can't tell if this is a bug or intended behavior. Is this that roxygen2 does not allow us to document objects that is not a function or a dataset?

@hadley hadley added the bug label Aug 16, 2017
@hadley
Copy link
Member

@hadley hadley commented Aug 17, 2017

Illustration of basic problem

out <- roc_proc_text(rd_roclet(), "
  #' Title
  #'
  hello <- 1
  #' @rdname hello
  mean.blah <- function(x) 2")[[1]]
out$get_field("usage")$values

out <- roc_proc_text(rd_roclet(), "
  #' Title
  mean.blah <- function(x) 2")[[1]]

out$get_field("usage")$values

Looks like rd class is getting lost so that results are double escaped

@hadley hadley closed this in c262d08 Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants