-
Notifications
You must be signed in to change notification settings - Fork 334
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
Unable to build articles with custom rmarkdown output formats #2319
Comments
My pkgdown CI run ran correctly about a week ago, it seems like the most likely culprit is the recent rmarkdown 2.22 release, but I don't immediately see anything relevant in the changes between 2.21 and 2.22. Here's the diff between session info results: https://www.diffchecker.com/mNuGIyyo/ |
Thanks for the reprex and investigation! From a quick thus not thorough exploration, it seems that rmarkdown gets some information from the YAML directly https://github.com/rstudio/rmarkdown/blob/58ca4df16a3a5c14f277b1878f9ff5b842fe1306/R/html_resources.R#LL212C3-L212C30 (I found this commit "promising") pkgdown passes a special output format (docs) but at that stage it seems the one that rmarkdown uses, is the one in the document. Maybe it's actually a rmarkdown bug then? 🤔 |
what I don't get is why the vignette can be rendered from RStudio IDE then? |
Thanks a lot @maelle This is indeed one of the latest fix at rstudio/rmarkdown#2486 that I believe trigger the issue. It is kind of side effect because
I just need to confirm this as I need to understand why exactly this happens when running in pkgdown and not just with rmarkdown. Something is triggered somehow Anyway, I'll fix this in rmarkdown - not a pkgdown issue IMO. @gadenbuie I have ideas, but happy to discuss with you on this for possibly broader / better support for all this (bslib theme, custom formats own arguments, ...) |
Thank you @cderv 🙏 |
I believe this is because pkgdown is explictly calling for Lines 62 to 70 in 39083f3
# parse the YAML front matter to discover resources named there
front_matter <- yaml_front_matter(md_file) And so some of the resources will be discovered and handled based on the YAML of the Rmd file output:
cleanrmd::html_document_clean:
theme: new.css
toc: true
toc_depth: 2 which I understand pkgdown ignores anyway. It does not seem to have a been an issue until now... So is this an underlying issue to think about ? We have the why this is triggered. About the actual error with |
So is any change needed on pkgdown side? Finding external resources is useful 😁 |
I guess this is working now, as not other issue reported, but I believe you are finding more resources that you need too because finding resources includes the YAML front matter content. But Only change to prevent "more files to be copied" (which is probably not an issue most of the time), would be to remove So it depends the pkgdown point of view on this. |
Just to confirm: rstudio/rmarkdown#2493 does indeed solve the problem for me, both in the reprex repo and in my original repo. Thanks @maelle and @cderv! |
This is a new error that has just popped up recently and that might not be entirely pkgdown's fault (but I haven't been able to track down a smaller reprex).
I have a package (cleanrmd) that provides alternative vignette output formats, which I use for vignettes in several packages.
I just started noticing failures building the pkgdown site with the following error
I've put together a repo with a reprex. Within that repo, building the articles with
pkgdown::build_articles()
will work for the standardrmarkdown::html_vignette
, but will fail for the custom method.One (probably very relevant detail) is that removing the
theme
value fromhtml_document_clean()
by commenting out that line will cause the articles to build correctly. (But IIUC the custom document format should be ignored entirely during the rendering.)The text was updated successfully, but these errors were encountered: