-
Notifications
You must be signed in to change notification settings - Fork 337
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
Quarto articles, in the vignettes/articles/*
sense, don't seem to work
#2821
Comments
Yes I can personally attest to success with |
Here's another toy package, that contains only a qmd article, also not able to build a pkgdown site: https://github.com/jennybc/fghij |
usethis 3.1.0 is on CRAN now (the version that adds |
The above workaround works, but is sort of clunky as it copies everything from the It would be better to figure out why the rendered quarto document and resources aren't built in the correct place from the get-go. I think we may just need a better way to specifiy a destination directory in |
Interestingly, this works if you call |
The problem is due to the following combination of things:
The problem is that in these lines pkgdown/R/build-quarto-articles.R Lines 46 to 50 in dfa28be
output_file refers to a path entry Lines 344 to 350 in dfa28be
so you end up with a pkg <- local_pkgdown_site()
pkg <- pkg_add_file(pkg, "vignettes/articles/quarto_article.qmd")
pkg <- pkg_add_file(pkg, "vignettes/quarto_vignette.qmd")
options(width = 200)
pkg$vignettes[,1:4]
# A tibble: 2 × 4
name type file_in file_out
<chr> <chr> <chr> <chr>
1 articles/quarto_article qmd vignettes/articles/quarto_article.qmd articles/quarto_article.html
2 quarto_vignette qmd vignettes/quarto_vignette.qmd articles/quarto_vignette.html
The solution in the fork @jennybc linked works because it moves the nested rendered articles out of the articles folder. I'm not sure why you think this is clunky as the only things in the articles subdir are things that you do want to move. This was never a problem for .Rmd files because they are rendered one by one and given file_out as the target. But the current code renders quarto files as a project, which respects the folder structure. The alternative solution is to fix file_out to depend on the file_in (instead of collapsing the folder structure), but that would have to be done just for .qmd files. |
The reason this wasn't caught is that there are no tests for quarto articles, just quarto vignettes. This test fails:
but it passes for the fork @jennybc linked. |
I'm working on making
usethis::use_vignette()
andusethis::use_article()
work for.qmd
. In that PR (r-lib/usethis#2085), I feel like I've got the right files going in the right places, etc., and.qmd
vignettes (vignettes/*.qmd
) seem fine. But when it comes time to build the site, I see problems with anything likevignettes/articles/*.qmd
:Trying to just build articles also falls over:
The toy package I'm working with: https://github.com/jennybc/abcde
In sleuthing around for packages that actually have
vignettes/articles/*.qmd
, I came across someone using their own fork and branch for qmd article rendering that I suspect is a workaround for what I'm seeing? 🤷♀️https://github.com/ethanbass/pkgdown/tree/qmd_articles
ethanbass@8b10575
I poked around a couple of other hits and so far haven't come across any where it looks like things are "just working" for anyone with
vignettes/articles/*.qmd
*.The text was updated successfully, but these errors were encountered: