CrumpLab / vertical

R workflow for sharing psychological research
https://crumplab.github.io/vertical/
Other
35 stars 2 forks source link

yml issues #9

Closed CrumpLab closed 4 years ago

CrumpLab commented 4 years ago

vertical is using pkgdown to render the website. The pkgdown yml file is used to control aspects of the website. Currently, this file needs to be edited by hand to add in bits that aren't rendered by pkgdown (e.g., .Rmds in the slides folder).

This is related to #6 in that custom build scripts will be necessary here. Likely this will involve

  1. compiling the .Rmds in their respective folders, then copying the html to the docs folder
  2. adding links in the yml to the files in the docs folder
CrumpLab commented 4 years ago

Another issue that I'm anticipating here is how to deal with the navbar at the top. Any .Rmd file in the vignettes folder get's compiled with the navbar stuff included, so that those pages are rendered underneath the navbar.

Sometimes it makes sense to render the page without the navbar, e.g., when generating a slide deck, you might want the link to go to a page with the slide deck sans navbar.

Other times you might want a new page to be rendered under the navbar. Let's say someone wanted a model folder, where they had an .Rmd file that generated some model and talked about it. They might want this .rmd to appear under the navbar. Currently this is possible by putting the model.Rmd into the vignettes folder, but not possible if model.Rmd was in a different folder.

CrumpLab commented 4 years ago

I've poked around some of the pkgdown functions, and haven't really resolved anything. I was hoping it would be relatively straightforward to modify the pkgdown functions that build the vignettes so that they could compile arbitrary .Rmds in other folders as vignettes, and add them to the list in the yml...but, this did not seem straightforward to me.

For the time being, it seems easiest to stay within the vignette system, and have additional .rmds (for supplementary materials, data-analysis, modeling etc.) all placed into the vignettes folder. Then they all automatically get rendered by pkgdown and placed in the articles tab.

more to chew on...

mvuorre commented 4 years ago

It might be reasonable to have vertical provide a full pkgdown.yml (even though some links would be dead if e.g. the user did not have experiments or slides), and then assume that users can edit that file by hand. It is easy and well documented in e.g. pkgdown documentation.

I agree it would be nice to sometimes have the navbar there and sometimes not, but I don't think theres anything you can do about it.

CrumpLab commented 4 years ago

I think enough of the yml issues have been resolved to close this general issue. I added update_yml() which does a decent job of updating _pkgdown.yml from vertical folders. No resolution of the missing navbar for .rmds not in the vignettes folder, but that will have to do for now. The getting started documentation describes further customization options.