Skip to content

Commit

Permalink
Merge pull request #2 from jimhester/master
Browse files Browse the repository at this point in the history
Emoji in your terminal too!
  • Loading branch information
hadley committed Apr 25, 2017
2 parents 9d78274 + d444a51 commit b8c1c97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Generated by roxygen2: do not edit by hand

S3method(print,emoji)
export(ji)
export(ji_find)
9 changes: 8 additions & 1 deletion R/ji.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#' emo::ji("banana")
#' emo::ji("monkey")
ji <- function(keyword) {
knitr::asis_output(find_emoji(keyword))
res <- knitr::asis_output(find_emoji(keyword))
class(res) <- c("emoji", class(res))
res
}

find_emoji <- function(keyword) {
Expand Down Expand Up @@ -49,3 +51,8 @@ ji_find <- function(keyword) {
emoji = unname(emoji_name[names])
)
}

#' @export
print.emoji <- function(x, ...) {
cat(x, "\n")
}

0 comments on commit b8c1c97

Please sign in to comment.