Skip to content

build_rmd() fails with some output format #2510

@cderv

Description

@cderv

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() ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions