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

Cannot use external files with Quarto vignettes/articles #2846

Open
venpopov opened this issue Jan 28, 2025 · 0 comments
Open

Cannot use external files with Quarto vignettes/articles #2846

venpopov opened this issue Jan 28, 2025 · 0 comments
Labels

Comments

@venpopov
Copy link

venpopov commented Jan 28, 2025

Unlike standard .Rmd vignettes, quarto vignettes cannot load external files during rendering. A minimal example: https://github.com/venpopov/quartopackagetest/tree/main/vignettes

two identical vignettes, one .Rmd and one .qmd try to readRDS("mtcars.rds") from a file in the vignettes folder. The .Rmd vignette renders succesfully, the .qmd vignette fails:

pkgdown::build_article("myquarto", quiet = FALSE)
Reading vignettes/myquarto.qmd
Running `quarto render`


processing file: myquarto.qmd
1/7                  
2/7 [unnamed-chunk-1]
3/7                  
4/7 [setup]          
5/7                  
6/7 [unnamed-chunk-2]
Error in `gzfile()`:
! cannot open the connection
Backtrace:
    ▆
 1. └─base::readRDS("mtcars.rds")
 2.   └─base::gzfile(file, "rb")


Quitting from lines 21-22 [unnamed-chunk-2] (myquarto.qmd)
Execution halted
Error in `quarto::quarto_render()` at pkgdown/R/build-quarto-articles.R:99:3:
✖ Error running quarto cli.
Caused by error:
! System command 'quarto' failed
Run `rlang::last_trace()` to see where the error occurred.

From some tests, it seems like the quarto vignettes are copied to a temporary directory for rendering, but other assets from the vignette folder are not included.

This is presenting an issue for our package, because we have computationally demanding models which we preload in articles to display results. Previously we used regular vignettes and everything worked fine. However, as documented here, and here, the recent update to 2.1.0 of pkgdown broke math rendering. In #2739 @hadley recommends switching to Quarto articles for long-term support, which is what lead me to the issue above.

This is unrelated to #2821 - the toy package above uses Quarto vignette, not articles. When I use the development version of pkgdown from github, I can work with Quarto articles since those were solved in #2826. But loading files remains not possible with neither vignettes nor articles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants