Skip to content

Commit

Permalink
Merge pull request #22 from jrdnbradford/add-logo
Browse files Browse the repository at this point in the history
Add logo
  • Loading branch information
jrdnbradford authored Sep 10, 2024
2 parents 723394f + 7df93b4 commit eb61985
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 2 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
^readMDTable\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^data-raw$
^\.github$
^_pkgdown\.yml$
^docs$
Expand Down
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ knitr::opts_chunk$set(
)
```

# readMDTable
# readMDTable <a href="https://jrdnbradford.github.io/readMDTable/"><img src="man/figures/logo.png" align="right" height="139" alt="readMDTable website" /></a>

<!-- badges: start -->
[![R-CMD-check](https://github.com/jrdnbradford/readMDTable/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jrdnbradford/readMDTable/actions/workflows/R-CMD-check.yaml)
[![Dev status](https://img.shields.io/github/r-package/v/jrdnbradford/readMDTable/main?label=Dev%20Version&logo=github&labelColor=3e474f&logoColor=959da5)](https://github.com/jrdnbradford/readMDTable)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# readMDTable
# readMDTable <a href="https://jrdnbradford.github.io/readMDTable/"><img src="man/figures/logo.png" align="right" height="139" alt="readMDTable website" /></a>

<!-- badges: start -->

Expand Down
Binary file added data-raw/stickers/logo-raw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions data-raw/stickers/logo.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
library(gridExtra)
library(grid)
library(magick)
library(hexSticker)
library(tibble)

raw_logo_path <- file.path("data-raw", "stickers", "logo-raw.png")

table_data <- tibble(
Feature = c("Name", "Title", "License", "GitHub"),
Description = c("Package name", "Package title", "License type", "Repository Link"),
Value = c("{readMDTable}", "Read Markdown Tables\ninto Tibbles", "GPL >= 3", "jrdnbradford/readMDTable")
)

table_grob <- tableGrob(table_data, rows = NULL)

png(raw_logo_path, width = 800, height = 600)
grid.newpage()
grid.draw(table_grob)
dev.off()

# See https://github.com/GuangchuangYu/hexSticker/issues/39
transparent_logo <- image_read(raw_logo_path) %>%
image_fill(color = "transparent", refcolor = "white", fuzz = 4, point = "+1+1") %>%
image_fill(color = "transparent", refcolor = "white", fuzz = 4, point = "+517+1") %>%
image_fill(color = "transparent", refcolor = "white", fuzz = 4, point = "+1+599") %>%
image_fill(color = "transparent", refcolor = "white", fuzz = 4, point = "+517+599")

image_write(image = transparent_logo, path = raw_logo_path)

sticker(
raw_logo_path,
package = "{readMDTable}",
p_size = 18,
p_y = 1.3,
p_color = "black",
s_x = 1,
s_y = 0.80,
s_width = 1.65,
s_height = 100,
h_fill = "white",
h_color = "#ff79c6",
dpi = 300,
filename = raw_logo_path
)

file.show(raw_logo_path)

usethis::use_logo(raw_logo_path)
Binary file added man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions man/readMDTable-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eb61985

Please sign in to comment.