Kaynağa Gözat

Revove purrr, adjust dependencies, update license

tags/v0.1.2
Garrick Aden-Buie 7 yıl önce
ebeveyn
işleme
a9d9f6cd28
6 değiştirilmiş dosya ile 36 ekleme ve 9 silme
  1. +1
    -0
      .Rbuildignore
  2. +1
    -2
      DESCRIPTION
  3. +2
    -0
      LICENSE
  4. +21
    -0
      LICENSE.md
  5. +2
    -0
      NAMESPACE
  6. +9
    -7
      R/ermoji_gadget.R

+ 1
- 0
.Rbuildignore Dosyayı Görüntüle

^LICENSE\.md$
^ermoji\.Rproj$ ^ermoji\.Rproj$
^\.Rproj\.user$ ^\.Rproj\.user$
^README\.Rmd$ ^README\.Rmd$

+ 1
- 2
DESCRIPTION Dosyayı Görüntüle

Description: RStudio addin to search through emoji and copy the emoji name, Description: RStudio addin to search through emoji and copy the emoji name,
unicode string or gliph to the clipboard. unicode string or gliph to the clipboard.
Authors@R: "Garrrick Aden-Buie <g.adenbuie@gmail.com> [aut, cre]" Authors@R: "Garrrick Aden-Buie <g.adenbuie@gmail.com> [aut, cre]"
License: MIT
License: MIT + file LICENSE
Encoding: UTF-8 Encoding: UTF-8
LazyData: true LazyData: true
ByteCompile: true ByteCompile: true
Imports: Imports:
emo, emo,
DT, DT,
purrr,
clipr clipr
Remotes: hadley/emo Remotes: hadley/emo
Depends: Depends:

+ 2
- 0
LICENSE Dosyayı Görüntüle

YEAR: 2018
COPYRIGHT HOLDER: Garrick Aden-Buie

+ 21
- 0
LICENSE.md Dosyayı Görüntüle

# MIT License

Copyright (c) 2018 Garrick Aden-Buie

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

+ 2
- 0
NAMESPACE Dosyayı Görüntüle



export(ermoji_gadget) export(ermoji_gadget)
export(ermoji_shiny) export(ermoji_shiny)
import(miniUI)
import(shiny)

+ 9
- 7
R/ermoji_gadget.R Dosyayı Görüntüle

#' @param ... Ignored at this time #' @param ... Ignored at this time
#' @name ermoji #' @name ermoji
#' @return nothing #' @return nothing
#' @import shiny
#' @import miniUI
#' @export #' @export
ermoji_gadget <- function(clipout = clipr::clipr_available(), ...) { ermoji_gadget <- function(clipout = clipr::clipr_available(), ...) {
require(shiny)
require(miniUI)
runGadget(ermoji_ui, ermoji_server(clipout, ...), viewer = paneViewer(500), stopOnCancel = FALSE) runGadget(ermoji_ui, ermoji_server(clipout, ...), viewer = paneViewer(500), stopOnCancel = FALSE)
} }


#' @rdname ermoji #' @rdname ermoji
#' @export #' @export
ermoji_shiny <- function(clipout = clipr::clipr_available(), ...) { ermoji_shiny <- function(clipout = clipr::clipr_available(), ...) {
require(shiny)
require(miniUI)
shinyApp(ui = ermoji_ui, server = ermoji_server(clipout, ...)) shinyApp(ui = ermoji_ui, server = ermoji_server(clipout, ...))
} }


output$emojis <- DT::renderDataTable({ output$emojis <- DT::renderDataTable({
emojis <- emo::jis emojis <- emo::jis
emojis <- emojis[, c('emoji', 'name', "group", "keywords", "aliases")] emojis <- emojis[, c('emoji', 'name', "group", "keywords", "aliases")]
emojis$keywords <- purrr::map_chr(emojis$keywords, ~ paste(., collapse = ", "))
emojis$aliases <- purrr::map_chr(emojis$aliases, ~ paste(., collapse = ", "))
emojis$keywords <- vapply(emojis$keywords, function(x) paste(x, collapse = ", "), character(1))
emojis$aliases <- vapply(emojis$aliases, function(x) paste(x, collapse = ", "), character(1))
DT::datatable( DT::datatable(
emojis, emojis,
rownames = FALSE, rownames = FALSE,
}) })


this_emoji_html <- reactive({ this_emoji_html <- reactive({
gsub("([0-9A-F]{4,8}) ?", "&#x\\1;", this_emoji()$runes)
rune2html(this_emoji()$runes)
}) })


truncate <- function(x, n = 10) { truncate <- function(x, n = 10) {
x = gsub('"', '&quot;', x) x = gsub('"', '&quot;', x)
x x
} }

rune2html <- function(runes) {
gsub("([0-9A-F]{4,8}) ?", "&#x\\1;", runes)
}

Yükleniyor…
İptal
Kaydet