-
-
Notifications
You must be signed in to change notification settings - Fork 974
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
Inject CSS styling into RMD parametrization app #866
base: main
Are you sure you want to change the base?
Changes from 1 commit
2858c1f
90b0ada
b0961f4
78958a6
99e714d
202f3e9
c1ab123
cfec064
7f4acd0
b8bb6f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,6 +250,7 @@ params_html_head <- function(html_head_style = c(), | |
#' You must take care to unsure that the URL is absolute. | ||
#' @param html_head_script_link same as above except that these are interpreted as SRC attributes in SCRIPT tags. | ||
#' You must take care to unsure that the URL is absolute. | ||
#' @param disable_bootstrap if true, does not inject boostrap scripts and styles in the HTML HEAD. | ||
#' | ||
#' @return named list with overridden parameter names and value. | ||
#' | ||
|
@@ -263,7 +264,8 @@ knit_params_ask <- function(file = NULL, | |
html_head_style = c(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One option that won't pollute the argument list so much is to have a single argument that accepts a named list. html_head = list() Then, if you want to specify some parts: html_head = list(style = "body { font-size: 15px; }") Not sure which would be preferred. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, when I replied in the email, it put the comments in the wrong place. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could indeed go either way. I agree with @trestletech that R tends to stylistically prefer long argument lists. Even though this isn't normally good form in more well decomposed systems in R where many operations tend to be top level "one button" ones it makes some sense (also forces documentation of the parameters in .Rd as a side benefit). |
||
html_head_script = c(), | ||
html_head_style_link = c(), | ||
html_head_script_link = c()) { | ||
html_head_script_link = c(), | ||
disable_bootstrap = FALSE) { | ||
|
||
if (is.null(input_lines)) { | ||
if (is.null(file)) { | ||
|
@@ -462,7 +464,9 @@ knit_params_ask <- function(file = NULL, | |
class = "container-fluid"), | ||
class = "navbar navbar-default navbar-fixed-bottom") | ||
|
||
ui <- shiny::tagList( | ||
buildPage <- ifelse((is.null(disable_bootstrap) | !isTruthy(disable_bootstrap)), shiny::bootstrapPage, shiny::tagList) | ||
|
||
ui <- buildPage( | ||
params_html_head( | ||
html_head_style = html_head_style, | ||
html_head_script = html_head_script, | ||
|
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 don't know what the common formatting is for this package, but you could consider styling with
if \code{TRUE}, does not...
Probably more important to align with the conventions of the package but just making sure you're aware of the option.