...and renamed from get_xaringanthemer_value()tags/v0.3.0
| @@ -6,7 +6,6 @@ export(darken_color) | |||
| export(duo) | |||
| export(duo_accent) | |||
| export(duo_accent_inverse) | |||
| export(get_xaringanthemer_value) | |||
| export(google_font) | |||
| export(google_language_codes) | |||
| export(lighten_color) | |||
| @@ -29,6 +28,7 @@ export(style_solarized_light) | |||
| export(style_xaringan) | |||
| export(theme_xaringan) | |||
| export(theme_xaringan_base) | |||
| export(theme_xaringan_get_value) | |||
| export(theme_xaringan_inverse) | |||
| export(theme_xaringan_set_defaults) | |||
| export(write_extra_css) | |||
| @@ -435,35 +435,79 @@ requires_xaringanthemer_env <- function() { | |||
| #' A helper function to retrieve the value of style settings as set by a | |||
| #' xaringanthemer style function, for use in plotting and other circumstances. | |||
| #' | |||
| #' @section Style Settings: | |||
| #' Style settings used by xaringanthemer include: | |||
| #' | |||
| #' - `background_color` | |||
| #' - `background_image` | |||
| #' - `background_position` | |||
| #' - `background_size` | |||
| #' - `blockquote_left_border_color` | |||
| #' - `code_font_family` | |||
| #' - `code_font_family_fallback` | |||
| #' - `code_font_google` | |||
| #' - `code_font_size` | |||
| #' - `code_font_url` | |||
| #' - `code_highlight_color` | |||
| #' - `code_inline_background_color` | |||
| #' - `code_inline_color` | |||
| #' - `code_inline_font_size` | |||
| #' - `extra_css` | |||
| #' - `extra_fonts` | |||
| #' - `footnote_color` | |||
| #' - `footnote_font_size` | |||
| #' - `footnote_position_bottom` | |||
| #' - `header_background_auto` | |||
| #' - `header_background_color` | |||
| #' - `header_background_content_padding_top` | |||
| #' - `header_background_ignore_classes` | |||
| #' - `header_background_padding` | |||
| #' - `header_background_text_color` | |||
| #' - `header_color` | |||
| #' - `header_font_family` | |||
| #' - `header_font_google` | |||
| #' - `header_font_url` | |||
| #' - `header_font_weight` | |||
| #' - `header_h1_font_size` | |||
| #' - `header_h2_font_size` | |||
| #' - `header_h3_font_size` | |||
| #' - `inverse_background_color` | |||
| #' - `inverse_header_color` | |||
| #' - `inverse_text_color` | |||
| #' - `inverse_text_shadow` | |||
| #' - `left_column_selected_color` | |||
| #' - `left_column_subtle_color` | |||
| #' - `link_color` | |||
| #' - `padding` | |||
| #' - `table_border_color` | |||
| #' - `table_row_border_color` | |||
| #' - `table_row_even_background_color` | |||
| #' - `text_bold_color` | |||
| #' - `text_color` | |||
| #' - `text_font_base` | |||
| #' - `text_font_family` | |||
| #' - `text_font_family_fallback` | |||
| #' - `text_font_google` | |||
| #' - `text_font_size` | |||
| #' - `text_font_url` | |||
| #' - `text_font_weight` | |||
| #' - `text_slide_number_color` | |||
| #' - `text_slide_number_font_size` | |||
| #' - `title_slide_background_color` | |||
| #' - `title_slide_background_image` | |||
| #' - `title_slide_background_position` | |||
| #' - `title_slide_background_size` | |||
| #' - `title_slide_text_color` | |||
| #' | |||
| #' @param setting A xaringanthemer style setting | |||
| #' @export | |||
| get_xaringanthemer_value <- function( | |||
| setting = c( | |||
| "header_background_content_padding_top", "table_row_border_color", | |||
| "text_bold_color", "code_highlight_color", "footnote_color", | |||
| "text_slide_number_color", "table_row_even_background_color", | |||
| "title_slide_text_color", "background_color", "extra_fonts", | |||
| "header_background_ignore_classes", "header_font_weight", "title_slide_background_image", | |||
| "background_size", "header_h2_font_size", "code_inline_font_size", | |||
| "text_font_google", "header_h1_font_size", "header_background_padding", | |||
| "header_font_family", "code_font_url", "text_font_url", "footnote_position_bottom", | |||
| "title_slide_background_position", "code_inline_color", "link_color", | |||
| "left_column_selected_color", "header_background_text_color", | |||
| "inverse_text_color", "text_color", "code_inline_background_color", | |||
| "extra_css", "outfile", "footnote_font_size", "header_h3_font_size", | |||
| "text_font_base", "code_font_google", "code_font_size", "title_slide_background_size", | |||
| "text_font_size", "padding", "text_font_family", "code_font_family", | |||
| "text_font_family_fallback", "blockquote_left_border_color", | |||
| "left_column_subtle_color", "table_border_color", "inverse_background_color", | |||
| "header_color", "inverse_header_color", "title_slide_background_color", | |||
| "header_background_color", "text_font_weight", | |||
| "background_image", "header_font_google", "text_slide_number_font_size", | |||
| "inverse_text_shadow", "code_font_family_fallback", "header_font_url", | |||
| "background_position", "header_background_auto") | |||
| ) { | |||
| theme_xaringan_get_value <- function(setting) { | |||
| requires_xaringanthemer_env() | |||
| setting <- match.arg(setting) | |||
| xaringanthemer_env[[setting]] | |||
| if (length(setting) > 1) { | |||
| xaringanthemer_env[setting] | |||
| } else { | |||
| xaringanthemer_env[[setting]] | |||
| } | |||
| } | |||
| web_to_point <- function(x, px_per_em = 16, scale = 1) { | |||
| @@ -27,7 +27,7 @@ reference: | |||
| - title: Helper functions | |||
| desc: Helpers for Google fonts and color adjustments. | |||
| contents: | |||
| - get_xaringanthemer_value | |||
| - theme_xaringan_get_value | |||
| - contains("color") | |||
| - apply_alpha | |||
| - choose_dark_or_light | |||
| @@ -1,38 +0,0 @@ | |||
| % Generated by roxygen2: do not edit by hand | |||
| % Please edit documentation in R/ggplot2.R | |||
| \name{get_xaringanthemer_value} | |||
| \alias{get_xaringanthemer_value} | |||
| \title{Get the Value of xaringanthemer Style Setting} | |||
| \usage{ | |||
| get_xaringanthemer_value(setting = c("header_background_content_padding_top", | |||
| "table_row_border_color", "text_bold_color", "code_highlight_color", | |||
| "footnote_color", "text_slide_number_color", | |||
| "table_row_even_background_color", "title_slide_text_color", | |||
| "background_color", "extra_fonts", "header_background_ignore_classes", | |||
| "header_font_weight", "title_slide_background_image", "background_size", | |||
| "header_h2_font_size", "code_inline_font_size", "text_font_google", | |||
| "header_h1_font_size", "header_background_padding", "header_font_family", | |||
| "code_font_url", "text_font_url", "footnote_position_bottom", | |||
| "title_slide_background_position", "code_inline_color", "link_color", | |||
| "left_column_selected_color", "header_background_text_color", | |||
| "inverse_text_color", "text_color", "code_inline_background_color", | |||
| "extra_css", "outfile", "footnote_font_size", "header_h3_font_size", | |||
| "text_font_base", "code_font_google", "code_font_size", | |||
| "title_slide_background_size", "text_font_size", "padding", | |||
| "text_font_family", "code_font_family", "text_font_family_fallback", | |||
| "blockquote_left_border_color", "left_column_subtle_color", | |||
| "table_border_color", "inverse_background_color", "header_color", | |||
| "inverse_header_color", "title_slide_background_color", | |||
| "header_background_color", "text_font_weight", "background_image", | |||
| "header_font_google", "text_slide_number_font_size", | |||
| "inverse_text_shadow", "code_font_family_fallback", "header_font_url", | |||
| "background_position", "header_background_auto")) | |||
| } | |||
| \arguments{ | |||
| \item{setting}{A xaringanthemer style setting} | |||
| } | |||
| \description{ | |||
| A helper function to retrieve the value of style settings as set by a | |||
| xaringanthemer style function, for use in plotting and other circumstances. | |||
| } | |||
| @@ -0,0 +1,82 @@ | |||
| % Generated by roxygen2: do not edit by hand | |||
| % Please edit documentation in R/ggplot2.R | |||
| \name{theme_xaringan_get_value} | |||
| \alias{theme_xaringan_get_value} | |||
| \title{Get the Value of xaringanthemer Style Setting} | |||
| \usage{ | |||
| theme_xaringan_get_value(setting) | |||
| } | |||
| \arguments{ | |||
| \item{setting}{A xaringanthemer style setting} | |||
| } | |||
| \description{ | |||
| A helper function to retrieve the value of style settings as set by a | |||
| xaringanthemer style function, for use in plotting and other circumstances. | |||
| } | |||
| \section{Style Settings}{ | |||
| Style settings used by xaringanthemer include: | |||
| \itemize{ | |||
| \item \code{background_color} | |||
| \item \code{background_image} | |||
| \item \code{background_position} | |||
| \item \code{background_size} | |||
| \item \code{blockquote_left_border_color} | |||
| \item \code{code_font_family} | |||
| \item \code{code_font_family_fallback} | |||
| \item \code{code_font_google} | |||
| \item \code{code_font_size} | |||
| \item \code{code_font_url} | |||
| \item \code{code_highlight_color} | |||
| \item \code{code_inline_background_color} | |||
| \item \code{code_inline_color} | |||
| \item \code{code_inline_font_size} | |||
| \item \code{extra_css} | |||
| \item \code{extra_fonts} | |||
| \item \code{footnote_color} | |||
| \item \code{footnote_font_size} | |||
| \item \code{footnote_position_bottom} | |||
| \item \code{header_background_auto} | |||
| \item \code{header_background_color} | |||
| \item \code{header_background_content_padding_top} | |||
| \item \code{header_background_ignore_classes} | |||
| \item \code{header_background_padding} | |||
| \item \code{header_background_text_color} | |||
| \item \code{header_color} | |||
| \item \code{header_font_family} | |||
| \item \code{header_font_google} | |||
| \item \code{header_font_url} | |||
| \item \code{header_font_weight} | |||
| \item \code{header_h1_font_size} | |||
| \item \code{header_h2_font_size} | |||
| \item \code{header_h3_font_size} | |||
| \item \code{inverse_background_color} | |||
| \item \code{inverse_header_color} | |||
| \item \code{inverse_text_color} | |||
| \item \code{inverse_text_shadow} | |||
| \item \code{left_column_selected_color} | |||
| \item \code{left_column_subtle_color} | |||
| \item \code{link_color} | |||
| \item \code{padding} | |||
| \item \code{table_border_color} | |||
| \item \code{table_row_border_color} | |||
| \item \code{table_row_even_background_color} | |||
| \item \code{text_bold_color} | |||
| \item \code{text_color} | |||
| \item \code{text_font_base} | |||
| \item \code{text_font_family} | |||
| \item \code{text_font_family_fallback} | |||
| \item \code{text_font_google} | |||
| \item \code{text_font_size} | |||
| \item \code{text_font_url} | |||
| \item \code{text_font_weight} | |||
| \item \code{text_slide_number_color} | |||
| \item \code{text_slide_number_font_size} | |||
| \item \code{title_slide_background_color} | |||
| \item \code{title_slide_background_image} | |||
| \item \code{title_slide_background_position} | |||
| \item \code{title_slide_background_size} | |||
| \item \code{title_slide_text_color} | |||
| } | |||
| } | |||