Просмотр исходного кода

Add missing Rd tags, namely value/@eturn

tags/v0.3.0
Garrick Aden-Buie 6 лет назад
Родитель
Сommit
7a5472a9ae
22 измененных файлов: 92 добавлений и 1 удалений
  1. +6
    -0
      R/color.R
  2. +1
    -0
      R/ggplot2.R
  3. +2
    -0
      R/utils.R
  4. +2
    -0
      R/xaringanthemer-deprecated.R
  5. +5
    -1
      man-roxygen/style-usage.R
  6. +3
    -0
      man/apply_alpha.Rd
  7. +4
    -0
      man/choose_dark_or_light.Rd
  8. +3
    -0
      man/google_font.Rd
  9. +3
    -0
      man/google_language_codes.Rd
  10. +4
    -0
      man/lighten_darken_color.Rd
  11. +5
    -0
      man/style_duo.Rd
  12. +5
    -0
      man/style_duo_accent.Rd
  13. +5
    -0
      man/style_duo_accent_inverse.Rd
  14. +5
    -0
      man/style_mono_accent.Rd
  15. +5
    -0
      man/style_mono_accent_inverse.Rd
  16. +5
    -0
      man/style_mono_dark.Rd
  17. +5
    -0
      man/style_mono_light.Rd
  18. +5
    -0
      man/style_solarized_dark.Rd
  19. +5
    -0
      man/style_solarized_light.Rd
  20. +5
    -0
      man/style_xaringan.Rd
  21. +3
    -0
      man/theme_xaringan_get_value.Rd
  22. +6
    -0
      man/xaringanthemer-deprecated.Rd

+ 6
- 0
R/color.R Просмотреть файл

#' scales::show_col(c(blue_light, blue, blue_dark)) #' scales::show_col(c(blue_light, blue, blue_dark))
#' } #' }
#' #'
#' @return A character string with the lightened or darkened color in
#' hexadecimal format.
#' @name lighten_darken_color #' @name lighten_darken_color
NULL NULL


#' scales::show_col(c(blue, blue_transparent)) #' scales::show_col(c(blue, blue_transparent))
#' } #' }
#' #'
#' @return A character string with added opacity level as hexadecimal characters.
#' @export #' @export
apply_alpha <- function(color_hex, opacity = 0.5) { apply_alpha <- function(color_hex, opacity = 0.5) {
paste0(color_hex, as.hexmode(round(255 * opacity, 0))) paste0(color_hex, as.hexmode(round(255 * opacity, 0)))
#' scales::show_col(c(light_green, contrast_green, dark_purple, contrast_purple)) #' scales::show_col(c(light_green, contrast_green, dark_purple, contrast_purple))
#' } #' }
#' #'
#' @return The `black` color or `white` color according to which color provides
#' the greates contrast with the input color.
#'
#' @export #' @export
choose_dark_or_light <- function(x, black = "#000000", white = "#FFFFFF") { choose_dark_or_light <- function(x, black = "#000000", white = "#FFFFFF") {
if (is_light_color(x)) eval(black) else eval(white) if (is_light_color(x)) eval(black) else eval(white)

+ 1
- 0
R/ggplot2.R Просмотреть файл

#' theme_xaringan_get_value("header_color") #' theme_xaringan_get_value("header_color")
#' theme_xaringan_get_value("text_bold_color") #' theme_xaringan_get_value("text_bold_color")
#' #'
#' @return The value of the xaringanthemer style parameter.
#' @export #' @export
theme_xaringan_get_value <- function(setting, css_file = NULL) { theme_xaringan_get_value <- function(setting, css_file = NULL) {
requires_xaringanthemer_env(css_file = css_file) requires_xaringanthemer_env(css_file = css_file)

+ 2
- 0
R/utils.R Просмотреть файл

#' @param ... Font weights to include, example "400", "400i" #' @param ... Font weights to include, example "400", "400i"
#' @param languages Font languages to include (dependent on the font.) See #' @param languages Font languages to include (dependent on the font.) See
#' [google_language_codes()]. #' [google_language_codes()].
#' @return A `"google_font"` object.
#' @export #' @export
google_font <- function(family, ..., languages = NULL) { google_font <- function(family, ..., languages = NULL) {
base <- "https://fonts.googleapis.com/css?family=" base <- "https://fonts.googleapis.com/css?family="
#' validates that the language codes given are valid. #' validates that the language codes given are valid.
#' @seealso [google_font()] #' @seealso [google_font()]
#' @param language_codes Vector of potential Google language codes #' @param language_codes Vector of potential Google language codes
#' @return A vector of Google Font language codes matching `language_codes`.
#' @export #' @export
google_language_codes <- function( google_language_codes <- function(
language_codes = c( language_codes = c(

+ 2
- 0
R/xaringanthemer-deprecated.R Просмотреть файл

#' #'
#' These functions in xaringanthemer have been deprecated or renamed. #' These functions in xaringanthemer have been deprecated or renamed.
#' #'
#' @param ... Argumets passed to the new or renamed functions.
#' @return The result of the new or renamed function.
#' @name xaringanthemer-deprecated #' @name xaringanthemer-deprecated
NULL NULL



+ 5
- 1
man-roxygen/style-usage.R Просмотреть файл

#' xaringan::moon_reader: #' xaringan::moon_reader:
#' css: xaringan-themer.css #' css: xaringan-themer.css
#' ```` #' ````
#
#'
#' @return The CSS styles are written to the file path provided in `outfile`
#' (by default to `xaringan-themer.css`). If `outfile` is `NULL`, the CSS is
#' returned directly as a character string.
#'

+ 3
- 0
man/apply_alpha.Rd Просмотреть файл



\item{opacity}{Desired opacity of the output color} \item{opacity}{Desired opacity of the output color}
} }
\value{
A character string with added opacity level as hexadecimal characters.
}
\description{ \description{
Applies alpha (or opacity) to a color in hexadecimal form by Applies alpha (or opacity) to a color in hexadecimal form by
converting opacity in the \verb{[0, 1]} range to hex in the \verb{[0, 255]} range converting opacity in the \verb{[0, 1]} range to hex in the \verb{[0, 255]} range

+ 4
- 0
man/choose_dark_or_light.Rd Просмотреть файл

\item{white}{Text or foreground color or expression, e.g. "#EEE" or \item{white}{Text or foreground color or expression, e.g. "#EEE" or
\code{substitute(lighten_color(x, 0.8))}, if white text provides the best contrast.} \code{substitute(lighten_color(x, 0.8))}, if white text provides the best contrast.}
} }
\value{
The \code{black} color or \code{white} color according to which color provides
the greates contrast with the input color.
}
\description{ \description{
Takes a color input as \code{x} and returns either the black or white color (or Takes a color input as \code{x} and returns either the black or white color (or
expression) if dark or light text should be used over the input color for expression) if dark or light text should be used over the input color for

+ 3
- 0
man/google_font.Rd Просмотреть файл

\item{languages}{Font languages to include (dependent on the font.) See \item{languages}{Font languages to include (dependent on the font.) See
\code{\link[=google_language_codes]{google_language_codes()}}.} \code{\link[=google_language_codes]{google_language_codes()}}.}
} }
\value{
A \code{"google_font"} object.
}
\description{ \description{
Builds Google Fonts URL from family name. Extra weights are given in the Builds Google Fonts URL from family name. Extra weights are given in the
\code{...} parameters. Languages can be specified in \code{langauges} and must one or \code{...} parameters. Languages can be specified in \code{langauges} and must one or

+ 3
- 0
man/google_language_codes.Rd Просмотреть файл

\arguments{ \arguments{
\item{language_codes}{Vector of potential Google language codes} \item{language_codes}{Vector of potential Google language codes}
} }
\value{
A vector of Google Font language codes matching \code{language_codes}.
}
\description{ \description{
Gives a list of valid Language Codes for Google Fonts, or Gives a list of valid Language Codes for Google Fonts, or
validates that the language codes given are valid. validates that the language codes given are valid.

+ 4
- 0
man/lighten_darken_color.Rd Просмотреть файл

where 0 is entirely the original color and 1 is entirely white where 0 is entirely the original color and 1 is entirely white
(\code{lighten_color()}) or black (\code{darken_color()}).} (\code{lighten_color()}) or black (\code{darken_color()}).}
} }
\value{
A character string with the lightened or darkened color in
hexadecimal format.
}
\description{ \description{
Produces a linear blend of the color with white or black. Produces a linear blend of the color with white or black.
} }

+ 5
- 0
man/style_duo.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
A duotone theme designed to work well with two complementary A duotone theme designed to work well with two complementary
colors. colors.

+ 5
- 0
man/style_duo_accent.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
An default xaringan theme with a two colors used for color An default xaringan theme with a two colors used for color
accents on select elements (headers, bold text, etc.). accents on select elements (headers, bold text, etc.).

+ 5
- 0
man/style_duo_accent_inverse.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
An "inverted" default xaringan theme with a two colors used An "inverted" default xaringan theme with a two colors used
for color accents on select elements (headers, bold text, etc.). for color accents on select elements (headers, bold text, etc.).

+ 5
- 0
man/style_mono_accent.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
The default xaringan theme with a single color used for color The default xaringan theme with a single color used for color
accents on select elements (headers, bold text, etc.). accents on select elements (headers, bold text, etc.).

+ 5
- 0
man/style_mono_accent_inverse.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
An "inverted" default xaringan theme with a single color used An "inverted" default xaringan theme with a single color used
for color accents on select elements (headers, bold text, etc.). for color accents on select elements (headers, bold text, etc.).

+ 5
- 0
man/style_mono_dark.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
A dark monotone theme based around a single color. A dark monotone theme based around a single color.
} }

+ 5
- 0
man/style_mono_light.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
A light monotone theme based around a single color. A light monotone theme based around a single color.
} }

+ 5
- 0
man/style_solarized_dark.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
A dark theme based around on the solarized color scheme. A dark theme based around on the solarized color scheme.
Works well with "\code{highlightStyle: solarized-dark}" or Works well with "\code{highlightStyle: solarized-dark}" or

+ 5
- 0
man/style_solarized_light.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
A light theme based around on the solarized color scheme. A light theme based around on the solarized color scheme.
Works well with "\code{highlightStyle: solarized-dark}" or Works well with "\code{highlightStyle: solarized-dark}" or

+ 5
- 0
man/style_xaringan.Rd Просмотреть файл



\item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
} }
\value{
The CSS styles are written to the file path provided in \code{outfile}
(by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
returned directly as a character string.
}
\description{ \description{
Creates a customized Xaringan theme CSS file. Creates a customized Xaringan theme CSS file.
} }

+ 3
- 0
man/theme_xaringan_get_value.Rd Просмотреть файл

if you have only saved your theme CSS file and you aren't creating your if you have only saved your theme CSS file and you aren't creating your
CSS theme with \pkg{xaringanthemer} in your slides' source file.} CSS theme with \pkg{xaringanthemer} in your slides' source file.}
} }
\value{
The value of the xaringanthemer style parameter.
}
\description{ \description{
A helper function to retrieve the value of style settings as set by a A helper function to retrieve the value of style settings as set by a
xaringanthemer style function, for use in plotting and other circumstances. xaringanthemer style function, for use in plotting and other circumstances.

+ 6
- 0
man/xaringanthemer-deprecated.Rd Просмотреть файл



solarized_dark(...) solarized_dark(...)
} }
\arguments{
\item{...}{Argumets passed to the new or renamed functions.}
}
\value{
The result of the new or renamed function.
}
\description{ \description{
These functions in xaringanthemer have been deprecated or renamed. These functions in xaringanthemer have been deprecated or renamed.



Загрузка…
Отмена
Сохранить