Currently only supports Font Awesome icons.

icon(name)

Arguments

name

string. name of the icon. You can see a full list of options at https://fontawesome.com/icons/.

Value

string containing the HTML code.

Note

Requires the Font Awesome HTML code: <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

Examples

rmd <- ' ```{r} library(rchallenge) ``` <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> `r icon("fa-user")` `r icon("fa-user fa-lg")` `r icon("fa-user fa-2x")` `r icon("fa-user fa-3x")` `r icon("fa-user fa-3x fa-border")` ' file <- tempfile() cat(rmd, file=file) writeLines(readLines(file))
#> #> ```{r} #> library(rchallenge) #> ``` #> <link rel="stylesheet" #> href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> #> `r icon("fa-user")` #> `r icon("fa-user fa-lg")` #> `r icon("fa-user fa-2x")` #> `r icon("fa-user fa-3x")` #> `r icon("fa-user fa-3x fa-border")`
if (rmarkdown::pandoc_available('1.12.3')) { rmarkdown::render(file) }
#> /usr/local/bin/pandoc +RTS -K512m -RTS file13dde032f2f.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output file13dde032f2f.html --lua-filter /Users/runner/work/_temp/Library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Users/runner/work/_temp/Library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --standalone --section-divs --template /Users/runner/work/_temp/Library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --include-in-header /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpcOhZNa/rmarkdown-str13dd730ebdd8.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
#> #> Output created: file13dde032f2f.html