Skip to content

Commit

Permalink
Merge pull request #2 from shinyworks/motivation
Browse files Browse the repository at this point in the history
Describe motivation in README.
  • Loading branch information
jonthegeek authored Oct 26, 2024
2 parents 6ab744e + 32cacac commit 653ea15
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 20 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Version: 0.0.0.9000
Authors@R:
person("Jon", "Harmon", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4781-4346"))
Description: Easily and flexibly use 'Font Awesome' icons as 'Shiny'
'favicons'. 'Font Awesome' is a popular set of icons that can be used
in web pages. 'favawesome' provides a simple way to use these icons
as 'favicons' in 'Shiny' applications and other HTML pages.
Description: Easily and flexibly use 'Font Awesome' icons as 'Shiny' 'favicons'
(the icons that appear on browser tabs). 'Font Awesome' is a popular set of
icons that can be used in web pages. 'favawesome' provides a simple way to
use these icons as 'favicons' in 'Shiny' applications and other HTML pages.
License: MIT + file LICENSE
URL: https://shinyworks.github.io/favawesome/,
https://github.com/shinyworks/favawesome
Expand Down
23 changes: 17 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/shinyworks/favawesome/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/shinyworks/favawesome/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

Easily and flexibly use Font Awesome icons as Shiny favicons.
Font Awesome is a popular set of icons that can be used in web pages.
favawesome provides a simple way to use these icons as favicons in Shiny applications and other HTML pages.
Easily and flexibly use {[fontawesome](https://rstudio.github.io/fontawesome/)} icons as Shiny favicons (the icons that appear on browser tabs).
[Font Awesome](https://fontawesome.com/) is a popular set of icons that can be used in web pages.
{favawesome} provides a simple way to use these icons as favicons in Shiny applications and other HTML pages.

## Installation

Expand All @@ -45,13 +45,24 @@ pak::pak("shinyworks/favawesome")
```
:::

## Motivation

If you've spent time in the Chrome Developer Tools Console (ctrl + shift + I) for Shiny apps, you may have seen this familiar error message:

```{r fig.alt="Failed to load resource: the server responded with a status of 404 () /favicon.ico:1", echo=FALSE}
knitr::include_graphics("man/figures/README-favicon_not_found.png")
```

False alarms make it easy to miss real error messages, so I wanted a way to silence that error message without adding a bunch of dependencies to my shiny app.
This package does not add any dependencies that are not already required by {[shiny](https://shiny.posit.co/r/)}.

## Usage

Add a call to `favawesome::fav()` at the top of your Shiny UI code or other HTML.
Add a call to `favawesome::fav()` to your Shiny UI code or other HTML.

``` r
html_page <- htmltools::tags$html(
fav("earth-africa", fill = "blue"),
favawesome::fav("earth-africa", fill = "blue"),
htmltools::tags$body(
htmltools::tags$h1("Hello world!"),
htmltools::tags$p("(on the browser tab)")
Expand All @@ -62,4 +73,4 @@ htmltools::html_print(html_page, viewer = utils::browseURL)

## Code of Conduct

Please note that the favawesome project is released with a [Contributor Code of Conduct](https://shinyworks.github.io/favawesome/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
Please note that the {favawesome} project is released with a [Contributor Code of Conduct](https://shinyworks.github.io/favawesome/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ coverage](https://codecov.io/gh/shinyworks/favawesome/graph/badge.svg)](https://
[![R-CMD-check](https://github.com/shinyworks/favawesome/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/shinyworks/favawesome/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

Easily and flexibly use Font Awesome icons as Shiny favicons. Font
Awesome is a popular set of icons that can be used in web pages.
favawesome provides a simple way to use these icons as favicons in Shiny
applications and other HTML pages.
Easily and flexibly use
{[fontawesome](https://rstudio.github.io/fontawesome/)} icons as Shiny
favicons (the icons that appear on browser tabs). [Font
Awesome](https://fontawesome.com/) is a popular set of icons that can be
used in web pages. {favawesome} provides a simple way to use these icons
as favicons in Shiny applications and other HTML pages.

## Installation

Expand All @@ -44,14 +46,26 @@ pak::pak("shinyworks/favawesome")

</div>

## Motivation

If you’ve spent time in the Chrome Developer Tools Console (ctrl +
shift + I) for Shiny apps, you may have seen this familiar error
message:

<img src="man/figures/README-favicon_not_found.png" alt="Failed to load resource: the server responded with a status of 404 () /favicon.ico:1" width="100%" />

False alarms make it easy to miss real error messages, so I wanted a way
to silence that error message without adding a bunch of dependencies to
my shiny app. This package does not add any dependencies that are not
already required by {[shiny](https://shiny.posit.co/r/)}.

## Usage

Add a call to `favawesome::fav()` at the top of your Shiny UI code or
other HTML.
Add a call to `favawesome::fav()` to your Shiny UI code or other HTML.

``` r
html_page <- htmltools::tags$html(
fav("earth-africa", fill = "blue"),
favawesome::fav("earth-africa", fill = "blue"),
htmltools::tags$body(
htmltools::tags$h1("Hello world!"),
htmltools::tags$p("(on the browser tab)")
Expand All @@ -62,7 +76,7 @@ htmltools::html_print(html_page, viewer = utils::browseURL)

## Code of Conduct

Please note that the favawesome project is released with a [Contributor
Code of
Please note that the {favawesome} project is released with a
[Contributor Code of
Conduct](https://shinyworks.github.io/favawesome/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.
2 changes: 1 addition & 1 deletion man/favawesome-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added man/figures/README-favicon_not_found.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 653ea15

Please sign in to comment.