Closed francisbarton closed 3 years ago
The icon package will now attempt to install the most recent version of the ionicons icon set, of which some icon names have changed. In version 5.2.3, the github icon is named "logo-github" rather than "social_github".
library(icon)
#> ── Installed icons ────────────────────────────────────────── icon 0.1.0.9000 ──
#> ✓ ionicons 5.2.3 ✓ material_design 4.0.0
#> ✓ academicons 1.9.1 ✓ fontawesome 5.15.2
#> ✓ simple_icons 4.4.0
ionicons
#> Ionicons icon set (version 5.2.3)
ionicons("logo-github")
Created on 2021-02-16 by the reprex package (v0.3.0)
The broken links is possibly a bug, I am investigating further.
The migrate_icon()
function was an idea that unfortunately is too complex to implement. The rewrite of icon not only changes the interface (which can be automatically migrated), but also allows installation of icon libraries at specific versions. Updating the icon name is trickier to migrate correctly.
MRE for hyperlink issue:
---
title: "icon"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
r icon::simple_icons("github")
r icon::simple_icons("github")
The hyperlink issue appears to not apply to icon::fontawesome
, so it might be a pandoc parsing issue with the format of icon::simple_icons()
svg structure.
---
title: "icon"
output: html_document
---
`r icon::fontawesome("github")`
[`r icon::fontawesome("github")`](https://github.com/mitchelloharawild/icon)
Thanks for those helpful responses, and for investigating. It must be quite a task to migrate over to the new system but I hope you'll be glad you did it.
It looks like the best thing for me to do is switch all my icons over to fontawesome.
BTW icon::icon_find("github")
doesn't include ionicons("logo-github")
in its results for some reason.
-- Installed icons ----------------------------------------- icon 0.2.0 --
v ionicons 5.5.0 x google_material
x academicons v octicons 12.0.0
v simple_icons 4.11.0 v fontawesome 5.15.2
At this stage icon_find()
will only return exact matches on the name of the icon. However I can see it being useful to allow partial matching of icon names here... possibly also regular expressions.
I've just updated an RMarkdown document that previously used the old style like
icon::ii("social_github")
. When used within a link, this used to work fine to create a linked icon:but now
a)
icon::ionicons()
does not seem to have an option for github icon or a twitter icon any more (nothing is found byfind_icon()
), - I can use Simple icons instead, but... b) the hyperlink is no longer rendered properly:renders with the literal brackets/braces and the URL visible, instead of creating a hyperlink.
Additionally,
icon::migrate_icon("index.Rmd")
gives