-
Notifications
You must be signed in to change notification settings - Fork 233
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
Templates and Markdown #594
Labels
Comments
Reproducible example: setwd(tempdir())
devtools::create("roxlate")
setwd("roxlate")
cat(
"Roxygen: list(markdown = TRUE)",
file = "DESCRIPTION",
sep = "\n",
append = TRUE
)
dir.create("man-roxygen")
cat(
"#' @param x This is a link to [stats::rnorm()].",
file = "man-roxygen/roxlate-rnorm.R",
sep = "\n"
)
cat(
"#' Foo.",
"#'",
"#' Description. Link: [stats::runif()]",
"#' @template roxlate-rnorm",
"#' @export",
"foo <- function(x) {}",
file = "R/foo.R",
sep = "\n"
)
devtools::document()
writeLines(readLines("man/foo.Rd")) This produces the file:
Note that the [stats::rnorm()] link was not processed, while the [stats::runif()] one was. |
This looks to be a problem of the global I can achieve the desired behavior for this example by adding a setwd(tempdir())
devtools::create("roxlate")
setwd("roxlate")
cat(
"Roxygen: list(markdown = TRUE)",
file = "DESCRIPTION",
sep = "\n",
append = TRUE
)
dir.create("man-roxygen")
cat(
"#' @md",
"#' @param x This is a link to [stats::rnorm()].",
file = "man-roxygen/roxlate-rnorm.R",
sep = "\n"
)
cat(
"#' Foo.",
"#'",
"#' Description. Link: [stats::runif()]",
"#' @template roxlate-rnorm",
"#' @export",
"foo <- function(x) {}",
file = "R/foo.R",
sep = "\n"
)
devtools::document()
writeLines(readLines("man/foo.Rd")) This writes: % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/foo.R
\name{foo}
\alias{foo}
\title{Foo.}
\usage{
foo(x)
}
\arguments{
\item{x}{This is a link to \code{\link[stats:rnorm]{stats::rnorm()}}.}
}
\description{
Description. Link: \code{\link[stats:runif]{stats::runif()}}
} |
@jayhesselberth Thanks for the digging! THis is a good workaround for now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Template files in
man-roxygen
don't seem to respect Markdown mode: krlmlr/dplyr@89b892f#commitcomment-20813612CC @gaborcsardi.
The text was updated successfully, but these errors were encountered: