Kaynağa Gözat

fa_icon() make as_html second arg

master
Garrick Aden-Buie 7 yıl önce
ebeveyn
işleme
402f313398
2 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. +2
    -2
      R/utils.R
  2. +3
    -3
      man/fa_icon.Rd

+ 2
- 2
R/utils.R Dosyayı Görüntüle

#' #'
#' Create the correct Font Awesome class. #' Create the correct Font Awesome class.
#' @param name Name of the Font Awesome icon #' @param name Name of the Font Awesome icon
#' @param solid Should the solid or the regular icon be used?
#' @param as_html If `FALSE` (default), only the icon class is returned. #' @param as_html If `FALSE` (default), only the icon class is returned.
#' @param solid Should the solid or the regular icon be used?
#' @examples #' @examples
#' fa_icon("github") #' fa_icon("github")
#' fa_icon("star") #' fa_icon("star")
#' #'
#' @references <https://fontawesome.com/icons> #' @references <https://fontawesome.com/icons>
#' @export #' @export
fa_icon <- function(name, solid = TRUE, as_html = FALSE) {
fa_icon <- function(name, as_html = FALSE, solid = TRUE) {
iconClass <- if (name %in% font_awesome_brands) "fab" else { iconClass <- if (name %in% font_awesome_brands) "fab" else {
if (solid) "fas" else "far" if (solid) "fas" else "far"
} }

+ 3
- 3
man/fa_icon.Rd Dosyayı Görüntüle

\alias{fa_icon} \alias{fa_icon}
\title{Font Awesome Icon} \title{Font Awesome Icon}
\usage{ \usage{
fa_icon(name, solid = TRUE, as_html = FALSE)
fa_icon(name, as_html = FALSE, solid = TRUE)
} }
\arguments{ \arguments{
\item{name}{Name of the Font Awesome icon} \item{name}{Name of the Font Awesome icon}


\item{solid}{Should the solid or the regular icon be used?}

\item{as_html}{If \code{FALSE} (default), only the icon class is returned.} \item{as_html}{If \code{FALSE} (default), only the icon class is returned.}

\item{solid}{Should the solid or the regular icon be used?}
} }
\description{ \description{
Create the correct Font Awesome class. Create the correct Font Awesome class.

Yükleniyor…
İptal
Kaydet