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

Best way to include a vignette in the package but not in the website? #2202

Closed
cbailiss opened this issue Oct 3, 2022 · 6 comments
Closed

Comments

@cbailiss
Copy link

cbailiss commented Oct 3, 2022

The docs describe how to include a vignette in the website but not in the package.
Is it possible to do the opposite? i.e. include a vignette in the package but not the website?

Previously I omitted the vignette from articles/contents the _pkgdown.yml but this no longer works - it fails now with:
Error in data_articles_index(pkg) : Vignettes missing from index: ...

This may sound an odd requirement, but I have two versions of one of my vignettes - a smaller, simpler version that is acceptable to CRAN and a longer version for the website.

Thanks

@maelle
Copy link
Collaborator

maelle commented Oct 4, 2022

If you build your website with GitHub Actions (see https://github.com/r-lib/actions/tree/v2-branch/examples#example-workflows + https://usethis.r-lib.org/reference/github_actions.html) you could add a step to your pkgdown workflow that would delete the vignette file after checking out the repository. This way pkgdown will then build the website from a source that does not have the vignette and therefore no error.

Something like

    steps:
      - uses: actions/checkout@v2

      - name: delete-vignette
        runs: rm vignettes/short.Rmd

@cbailiss
Copy link
Author

cbailiss commented Oct 4, 2022

Thank you for the reply. I assume this means there is no way to configure this at present, e.g. a setting in the _pkgdown.yml file? As much as anything, I just want to check that I've not missed an obvious way to exclude a vignette from the website through config. If that's the case, feel free to confirm that and then either close this or convert it to a feature request. Thanks.

@maelle
Copy link
Collaborator

maelle commented Oct 4, 2022

Oh right we had discussed your opening a feature request. Indeed it is not possible yet.

@maelle
Copy link
Collaborator

maelle commented Oct 4, 2022

For reference #2055 (comment)

@maelle
Copy link
Collaborator

maelle commented Oct 4, 2022

Edit: that comment was not you, the avatars just looked similar at a very first glance. 😅

@cbailiss
Copy link
Author

cbailiss commented Oct 4, 2022

Ha, that's funny. Thanks for confirming. As noted in #2055 I will close this and open a new issue as a feature request.

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

No branches or pull requests

2 participants