Skip to content

Commit

Permalink
Don't need knitr at all
Browse files Browse the repository at this point in the history
And better example of inline usage
  • Loading branch information
hadley committed Apr 25, 2017
1 parent b8c1c97 commit 97754fd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Expand Up @@ -12,7 +12,6 @@ License: GPL-3
Encoding: UTF-8
LazyData: true
Imports:
knitr,
tibble
RoxygenNote: 6.0.1
URL: https://github.com/hadley/emo
Expand Down
7 changes: 4 additions & 3 deletions R/ji.R
Expand Up @@ -7,9 +7,10 @@
#' emo::ji("banana")
#' emo::ji("monkey")
ji <- function(keyword) {
res <- knitr::asis_output(find_emoji(keyword))
class(res) <- c("emoji", class(res))
res
structure(
find_emoji(keyword),
class = "emoji"
)
}

find_emoji <- function(keyword) {
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Expand Up @@ -44,7 +44,7 @@ emo::ji("face")
emo::ji("face")
```

Often you'll use inline like `r '\u60r emo::ji("smile")\u60'`
Often you'll use inline like `r '\u60\u60 \u60r emo::ji("smile")\u60 \u60\u60'` `r emo::ji("smile")`

## Keywords

Expand Down
20 changes: 5 additions & 15 deletions README.md
Expand Up @@ -24,31 +24,21 @@ You can either refer to emoji by their name (which is unique):

``` r
emo::ji("poop")
#> πŸ’©
```

πŸ’©

Or by a keyword. Keywords are not unique so emo::ji will pick one for you at random.

``` r
emo::ji("face")
```

πŸ˜„

``` r
#> πŸ˜„
emo::ji("face")
```

😲

``` r
#> 😲
emo::ji("face")
#> 😣
```

😣

Often you'll use inline like `r emo::ji("smile")`
Often you'll use inline like `` `r emo::ji("smile")` `` πŸ˜„

Keywords
--------
Expand Down

0 comments on commit 97754fd

Please sign in to comment.