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

Discourage use of build_vignettes() #2488

Open
hadley opened this issue Dec 6, 2022 · 2 comments
Open

Discourage use of build_vignettes() #2488

hadley opened this issue Dec 6, 2022 · 2 comments

Comments

@hadley
Copy link
Member

hadley commented Dec 6, 2022

Since it creates artefacts in a way that we no longer recommend.

@jennybc
Copy link
Member

jennybc commented Dec 9, 2022

Having thought about this a lot while revising R Package, I'm going to record some thoughts before they leave my head.

Why do people use build_vignettes() and, in each case, what do I think is the better way to go:

  1. To build their vignettes and have a look at them, because they are actively working on the vignettes.

    I now think this is a job for devtools::build_rmd() or click the "Install" button in RStudio then the "Knit" button.

  2. To build their vignettes, for local reading by the local user.

    I now think this means you should build and install your package locally.

  3. To make built vignettes available for other people to read, because your package is not on CRAN or you want to make vignettes available for the dev version. Presumably it's a given that the package in question is available on GitHub (or similar).

    I now think this means you should (a) have a pkgdown website and it should either (b) be based on the dev version or have both released and dev sites.

  4. To make built vignettes available for other people to install.

    Either let people do install_github(dependencies = TRUE, build_vignettes = TRUE) or, if you're worried they can't build vignettes, then advise folks to install from r-universe.

What's wrong with build_vignettes()?

  • It leaves a package in a weird state that has features of a source package and an un-packed package bundle.
  • It tends to worsen confusion of the novice or occasional package developer, because of the weird state.
  • It just leads to the need for more workarounds and shims for "regular" tools. I.e. "how do we make browseVignettes() and vignette() find not-really-installed vignettes?"

@hadley
Copy link
Member Author

hadley commented Dec 10, 2022

One other thought on the first point: I think we should work with @romainfrancois to make knitting a vignette automatically install the package to a temporary library path first (figuring out some caching to make it not too slow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants