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

Custom knit function for vignettes #2203

Open
hadley opened this issue Mar 20, 2020 · 1 comment
Open

Custom knit function for vignettes #2203

hadley opened this issue Mar 20, 2020 · 1 comment
Labels
feature a feature request or enhancement vignettes 📜

Comments

@hadley
Copy link
Member

hadley commented Mar 20, 2020

It's possible to customise what happens when you click the "Knit" button with a knit field in the yaml metadata: https://bookdown.org/yihui/rmarkdown-cookbook/custom-knit.html. For README.Rmd and vignettes, we should set this to a function that uses with_temp_install() so you don't need to manually install the package in order to preview vignettes.

(In order for RStudio preview to work, the function needs to output Output created: {path}, e.g. https://github.com/ramnathv/slidify/blob/master/R/slidify.R#L89-L101)

@hadley
Copy link
Member Author

hadley commented Mar 20, 2020

The main challenge is that the knit function is run in a child session, so we'll need to think about how to convey what the current package is and where to look for the temporary library. Maybe load_all() could set an env var? (That would at least be consistent with needing to do a load_all() before you can preview dev docs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement vignettes 📜
Projects
None yet
Development

No branches or pull requests

2 participants