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

Proposal of new function: build_manual() #1238

Closed
twolodzko opened this issue Jun 24, 2016 · 7 comments
Closed

Proposal of new function: build_manual() #1238

twolodzko opened this issue Jun 24, 2016 · 7 comments
Labels
feature a feature request or enhancement

Comments

@twolodzko
Copy link
Contributor

twolodzko commented Jun 24, 2016

As far as I know, devtools do not offer possibility to easily and directly build pdf manual. Maybe something like the function below could be added?

#' Create package manual
#' 
#' @param pkg package description, can be path or package name.  See
#'   \code{\link{as.package}} for more information
#' @param path path in which to produce package.  If \code{NULL}, defaults to
#'   the parent directory of the package.
#' 
#' @seealso \code{\link{RdUtils}} 
#' @export

build_manual <- function(pkg = ".", path = NULL) {
  pkg <- as.package(pkg)
  if (is.null(path)) {
    path <- dirname(pkg$path)
  }
  name <- paste0(pkg$package, "_", pkg$version, ".pdf", collapse = " ")
  system(paste0("R CMD Rd2pdf --force --output=", path, "/", name, " ", shQuote(pkg$path), collapse = " "))
}
@AndreasChristianHill
Copy link

After installing the latest devtools release, I also just ran into the issue that running "check" or "build" does no longer produce a pdf-manual. It says --no-manual and I don't know how to change this. Is this a new issue of devtools or did i might have changed some settings?

@AndreasChristianHill
Copy link

@twolodzko Spending a bit more time reading the devtools-manual, I figured out that all options (including producing a pdf-manual) can actually be set if you call the respective functions "check" and "build" in the command line. E.g. checking with producing a manual goes like check(pkg = ".", document = TRUE, build_args = NULL, ..., manual = TRUE, cran = TRUE, check_version = FALSE, force_suggests = FALSE, run_dont_test = FALSE, args = NULL, env_vars = NULL, quiet = FALSE, check_dir = tempdir(), cleanup = TRUE).
However, it seems to me that these options cannot be changed using the "configure build tools" in RStudio anymore. That would be worth a request @hadley in my opinion.

@twolodzko
Copy link
Contributor Author

@AndreasChristianHill sorry, this is what I meant - Rstudio. Running check(manual=TRUE) works fine, but needs you to wait until compilation, while R CMD Rd2pdf works instantly. As about Rstudio, I did not found any way to revert the default behavior to produce pdf's.

@hadley
Copy link
Member

hadley commented Aug 2, 2017

This seems like a good idea, but unfortunately it's not high enough on my priority list that I will implement it myself. However, I'd be happy to review a PR.

@hadley hadley closed this as completed Aug 2, 2017
@twolodzko
Copy link
Contributor Author

@hadley what about the code I proposed in my initial message? I may pull it (it works for me on Windows and Linux), but I can't see point of PR if for some reason you find it insufficient. Also my knowledge of what can go wrong in producing the pdf manuals is limited to practical issues, so I don't know what could potentially go wrong with the code (if it can).

@hadley
Copy link
Member

hadley commented Aug 2, 2017

Yeah, that seems a fine place to start for a PR.

hadley pushed a commit that referenced this issue Aug 3, 2017
@lock
Copy link

lock bot commented Sep 18, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants