-
Notifications
You must be signed in to change notification settings - Fork 286
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
Refactor use_vignette()
#1700
Refactor use_vignette()
#1700
Conversation
@@ -26,6 +26,8 @@ use_vignette <- function(name, title = name) { | |||
check_vignette_name(name) | |||
|
|||
use_dependency("knitr", "Suggests") | |||
use_dependency("rmarkdown", "Suggests") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems worthy of a news bullet.
|
||
if (!is.null(subdir)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by change. I just prefer if (TRUE)
instead of if (!TRUE)
.
@@ -54,15 +63,13 @@ use_vignette_template <- function(template, name, title, subdir = NULL) { | |||
use_directory(path("vignettes", subdir)) | |||
} | |||
use_git_ignore(c("*.html", "*.R"), directory = "vignettes") | |||
use_dependency("rmarkdown", "Suggests") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of any reason why we did this here specifically 🤔
Motivated by experiments made while updating R Packages
Basically I found it confusing that knitr was added to
DESCRIPTION
early 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