-
Notifications
You must be signed in to change notification settings - Fork 335
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
start moving templates #1481
start moving templates #1481
Conversation
maelle
commented
Feb 2, 2021
- Move current templates to a folder called BS3.
- Modified the code so that templates can be found there.
- Added a copy of BS3 templates in a folder called BS4, for having a better diff when these become actual BS4 templates.
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.
A few initial comments. This would also be easier to review without the new BS4 starter templates, so I'd suggest removing for now.
"docsearch", | ||
ext = ".json", | ||
bs_version = get_bs_version(pkg) | ||
) |
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.
WS
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.
And in function calls below
|
||
if (!is.null(template$bootstrap)) { | ||
if (!template$bootstrap %in% c(3, 4)) { | ||
stop("The Bootstrap version `bootstrap` has to be 3 or 4.", call. = FALSE) |
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.
Can you please follow https://style.tidyverse.org/error-messages.html ?
I think pkgdown uses rlang already, so please use abort()
and then the error message should be a "must" statement, like "Boostrap version must be 3 or 4".
if (!is.null(template$bootstrap)) { | ||
if (!template$bootstrap %in% c(3, 4)) { | ||
stop("The Bootstrap version `bootstrap` has to be 3 or 4.", call. = FALSE) | ||
} |
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'd make this an else statement so the overall structure is like:
if (has_parameter) {
if (parameter_ok) {
} else {
abort(....)
} else {
3
}
Then it's more clear that the else clause if is very simple, so I think it's clearer to flip the order so that the simplest case becomes an early exit:
if (is.null(template$bootstrap)) {
return(3)
}
Opened #1485 instead (but used the comments from here). |