pkgdown
pkgdown copied to clipboard
vignettes with child documents now fail
The package_vignettes() function just grabs all .[Rr]md files, and errors if any of the resultant name entries are missing from the index. Vignettes can, however, be constructed with child documents which should not be specified in the index. This new error-instead-of-warning behaviour prevents building any packages which use that structure. Fixing that behaviour would be appreciated. Thanks!
I think a docs clarification is what's needed here:
Because pkgdown will build all these Rmd files under vignettes/, if you want to store child document in that folder you need to have their name start with an underscore. Actually it's in the docs but we might need to remove "in bookdown" https://pkgdown.r-lib.org/reference/build_articles.html
https://github.com/r-lib/pkgdown/blob/b6affbcb84411e961d9ec721f184e0a377b8e657/R/package.R#L233
In your example https://github.com/mpadge/pkgdown-test/ (thanks for this!), if I build it with a special pkgdown version where I remove the error message, I get articles/child-docs/child-doc.html.
A possible feature would be to have a way to exclude folders from pkgdown searching but that sounds like more complexity than what's needed. :slightly_smiling_face:
git blame didn't help me understand why the docs mention "in bookdown".
Actually, one thing that's annoying is that the filename has to start with an underscore, it might be nicer if the subfolder name could start with an underscore.
Hi Maelle:
On my pkgdown sites I like to have a FAQ that is in the top navbar, but not in the Articles list. I used to be able to do this in the YAML as follows:
navbar: type: inverse structure: right: [home, intro, articles, reference, faq, news, github] components: faq: text: FAQ content: href: ./articles/procs-faq.html
Now I get this error. Appending an underscore to the file name does indeed avoid the error. But the FAQ file is also entirely excluded from the pkgdown site. I want it as part of the site. Just don't want it in my articles list. It seems like there should be a way to do this. Do you have any recommendations?
Thanks,
David
Could you add a comment to #2205 describing your use case? Compared to that feature request, you want the vignette built but not linked from the articles index, which is different, but, well, related. :smile_cat: