Skip to content

Commit

Permalink
🔥 Add v0.1.0 install instructions to README
Browse files Browse the repository at this point in the history
Resolves #66
  • Loading branch information
mitchelloharawild committed Aug 10, 2023
1 parent 2dbcb3d commit 34e2d96
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 23 deletions.
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ icon_find("rocket")

This is the second iteration of the icon package, the [first icon package](https://github.com/ropenscilabs/icon) has been successful, but lacked a few features such as SVG icons, user defined libraries, and extensibility support. You can read the notes on the new API [here](https://github.com/ropenscilabs/icon/issues/19). It turns out that it was easier to build the new and improved icon from scratch, which is what this repository is. In the future this version of icon might just be merged into rOpenScilabs/icon, but for the mean time it will be developed here. We anticipate that there will only be any minor changes to the existing API, so hopefully this will be a seamless transition for users! Notably, the `icon_name` functions have been removed in favour of `icon$name`, and the interface for styling and animating has been removed/changed.

If you need to use the first version of the package that was developed from the rOpenSci hackathon, you can install it with `remotes::install_github("mitchelloharawild/[email protected]")`.
54 changes: 31 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status](https://github.com/mitchelloharawild/icons/workflows/R-CMD-check/badge.s
[![Coverage
status](https://codecov.io/gh/mitchelloharawild/icons/branch/master/graph/badge.svg)](https://codecov.io/gh/mitchelloharawild/icon?branch=master)
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/icon)](https://cran.r-project.org/package=icons)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/icon)](https://cran.r-project.org/package=icons)
<!-- [![Downloads](http://cranlogs.r-pkg.org/badges/icons?color=brightgreen)](https://cran.r-project.org/package=icons) -->

The `icons` package for R makes adding web icons to reports,
Expand All @@ -23,16 +23,16 @@ what is possible with emoji.
The `icons` package currently provides helpful tools for downloading and
using icons from these libraries:

- [Font Awesome](https://github.com/FortAwesome/Font-Awesome/) (Pro
icons can be used using custom icon sets)
- [Ionicons](https://github.com/ionic-team/ionicons/)
- [Academicons](https://github.com/jpswalsh/academicons)
- [Simple Icons](https://github.com/simple-icons/simple-icons/)
- [Google’s Material
Design](https://github.com/google/material-design-icons)
- [Octicons](https://github.com/primer/octicons)
- [Feather Icons](https://github.com/feathericons/feather)
- [Bioicons](https://github.com/duerrsimon/bioicons)
- [Font Awesome](https://github.com/FortAwesome/Font-Awesome/) (Pro
icons can be used using custom icon sets)
- [Ionicons](https://github.com/ionic-team/ionicons/)
- [Academicons](https://github.com/jpswalsh/academicons)
- [Simple Icons](https://github.com/simple-icons/simple-icons/)
- [Google’s Material
Design](https://github.com/google/material-design-icons)
- [Octicons](https://github.com/primer/octicons)
- [Feather Icons](https://github.com/feathericons/feather)
- [Bioicons](https://github.com/duerrsimon/bioicons)

# Installation

Expand All @@ -52,26 +52,28 @@ icons you would use `download_fontawesome()`.

``` r
library(icons)
#> ── Installed icons ─────────────────────────────────────────────── icon 0.2.0 ──
#> ionicons 5.2.3 ✓ feather_icons v4.28.0
#> academicons 1.9.1 ✓ octicons 11.2.0
#> simple_icons 4.4.0 ✓ fontawesome 5.15.2
#> ✓ google_material 4.0.0
#> -- Installed icons ----------------------------------------------- icon 0.2.0 --
#> v ionicons 5.2.3 v google_material 4.0.0
#> v academicons 1.9.1 v feather_icons v4.28.0
#> v simple_icons 4.4.0 v octicons 11.2.0
#> v bioicons 1.0.0 v fontawesome 5.15.2
```

Icons can be inserted inline using inline code
`` `r icons::fontawesome("rocket", style = "solid")` ``
<img src="man/figures/load-1.svg" height="16px"/> or
`` `r icons::fontawesome$solid$rocket` ``
<img src="man/figures/load-1.svg" height="16px"/>.
<img src="/tmp/Rtmpl6Yazw/file321ffb1f6442d.png" style="height:0.7em" />
or `` `r icons::fontawesome$solid$rocket` ``
<img src="/tmp/Rtmpl6Yazw/file321ffb6addfad0.png"
style="height:0.7em" />.

Icons can also be inserted using usual R chunks.

```{r icon-chunk}
fontawesome("rocket", style = "solid") # equivalent to icons::fontawesome$solid$rocket
```

<img src="man/figures/icon-chunk-1.svg" height="16px"/>
<img src="/tmp/Rtmpl6Yazw/file321ffb1c8254ab.png"
style="height:0.7em" />

If the icon name contains non-syntactic name characters like a `-` or
`+`, you will need to quote the name with backticks, single or double
Expand All @@ -81,7 +83,8 @@ quotes:
fontawesome$brands$`r-project` # or 'r-project' or "r-project"
```

<img src="man/figures/icon-syntax-1.svg" height="16px"/>
<img src="/tmp/Rtmpl6Yazw/file321ffb21882b13.png"
style="height:0.7em" />

The appearance of an icon can be customised using the `icon_style()`
function.
Expand All @@ -90,7 +93,8 @@ function.
icon_style(fontawesome("rocket", style = "solid"), scale = 2, fill = "red")
```

<img src="man/figures/icon-style-1.svg" height="32px"/>
<img src="/tmp/Rtmpl6Yazw/file321ffb1191f165.png"
style="height:1.4em" />

Custom icon sets can be created using the `icon_set()` function, which
accepts a directory of SVG files and allows them to be used as icons.
Expand All @@ -100,7 +104,7 @@ accepts a directory of SVG files and allows them to be used as icons.
custom$icons
```

<img src="man/figures/icon-custom-1.svg" height="16px"/>
<img src="/tmp/Rtmpl6Yazw/file321ffbeca7fa2.png" style="height:0.7em" />

You can also search for icons using the `icon_find()` function.

Expand Down Expand Up @@ -140,3 +144,7 @@ changes to the existing API, so hopefully this will be a seamless
transition for users! Notably, the `icon_name` functions have been
removed in favour of `icon$name`, and the interface for styling and
animating has been removed/changed.

If you need to use the first version of the package that was developed
from the rOpenSci hackathon, you can install it with
`remotes::install_github("mitchelloharawild/[email protected]")`.

0 comments on commit 34e2d96

Please sign in to comment.