Skip to content
New issue

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

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

Already on GitHub? # to your account

build_rmd() fails with some output format #2510

Open
cderv opened this issue Apr 19, 2023 · 1 comment
Open

build_rmd() fails with some output format #2510

cderv opened this issue Apr 19, 2023 · 1 comment
Labels
feature a feature request or enhancement

Comments

@cderv
Copy link

cderv commented Apr 19, 2023

devtools::build_rmd() is supposed to be a generic function to build any rmd

Currently it will error on some format like rmardown::pdf_document() (which could be used in vignettes too) because of

# Ensure rendering github_document() doesn't generate HTML file
output_options$html_preview <- FALSE

> devtools::build_rmd("vignettes/demo.Rmd")
ℹ Installing dummyPkg in temporary libraryBuilding C:/Users/chris/Documents/dummyPkg/vignettes/demo.Rmd
Error in rmarkdown::pdf_document(..., template = template) : 
  argument inutilisé (html_preview = FALSE)
Error:
! ! in callr subprocess.
Caused by error in `rmarkdown::pdf_document(..., template = template)`:
! argument inutilisé (html_preview = FALSE)

This is because html_preview is not part of pdf_document() arguments, and pdf_document() does not have an ignore ... where those unused argument can go.

We could add this ... argument, like rmarkdown::html_document_base() has, but really this option html_preview is only to be used with github_document() IMO. So maybe setting this option was supposed to be part of build_readme() and not build_rmd() ?

@jennybc
Copy link
Member

jennybc commented Nov 2, 2023

I'm not so sure that build_rmd() was intended to be a generic function to build any .Rmd. I think the origin story is more that we like having build_readme() and it made sense to implement that as a special case of something slightly more generic. I suspect that the way things are is what's best, for the devtools use cases, than trying to make build_rmd() more general.

That being said, if you want to make a PR with your proposed change, we can discuss further. How is this coming up for you?

@jennybc jennybc added the feature a feature request or enhancement label Nov 2, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants