Refactor use_vignette()#1700
Merged
Merged
Conversation
jennybc
commented
Nov 8, 2022
| check_vignette_name(name) | ||
|
|
||
| use_dependency("knitr", "Suggests") | ||
| use_dependency("rmarkdown", "Suggests") |
Member
Author
There was a problem hiding this comment.
I hoisted this up out of a helper.
| if (!"rmarkdown" %in% deps$package) { | ||
| ui_done(" | ||
| Adding {ui_value('rmarkdown')} to {ui_field('Config/Needs/website')}") | ||
| use_description_list("Config/Needs/website", "rmarkdown") |
Member
Author
There was a problem hiding this comment.
Since we're doing this here in use_article() specifically, we know enough to avoid adding markdown as an actual dependency in the case of an "articles only" package. I.e. then you only need it in Config/Needs/website.
Member
There was a problem hiding this comment.
This seems worthy of a news bullet.
| use_git_ignore(c("*.html", "*.R"), directory = "vignettes") | ||
| use_dependency("rmarkdown", "Suggests") | ||
|
|
||
| if (!is.null(subdir)) { |
Member
Author
There was a problem hiding this comment.
Drive-by change. I just prefer if (TRUE) instead of if (!TRUE).
jennybc
commented
Nov 8, 2022
| use_directory(path("vignettes", subdir)) | ||
| } | ||
| use_git_ignore(c("*.html", "*.R"), directory = "vignettes") | ||
| use_dependency("rmarkdown", "Suggests") |
Member
Author
There was a problem hiding this comment.
I can't think of any reason why we did this here specifically 🤔
hadley
approved these changes
Nov 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivated by experiments made while updating R Packages
Basically I found it confusing that knitr was added to
DESCRIPTIONearly on and then ... later ... rmarkdown was added.I can't think of any reason why we had it this way and looking through git blame didn't shed any light either.
This seems more obvious and obviously correct to me.
BEFORE
AFTER