Skip to content

Commit

Permalink
chore: Add a basic logo
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorld committed Oct 8, 2021
1 parent 5d2bfda commit 45854ee
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
CONTRIBUTING
README.rst
^README.html$
cran-comments.rst
.travis.yml
^\.appveyor\.yml$
^revdep$
^_pkgdown.yml$
^.lintr$
^\.github$
^pkgdown$
^raw-data$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
*.timestamp
argparse.rst
README.md
README.html
revdep
pkgdown
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ argparse: Command line optional and positional argument parser
:target: https://cran.r-project.org/package=argparse
:alt: RStudio CRAN mirror downloads

.. raw:: html

<img src="man/figures/logo.png" align="right" width="200px" alt="argparse hex sticker">


``argparse`` is an R package which provides a command line parser to
be used with Rscript to write "#!" shebang scripts that gracefully
accept positional and optional arguments and automatically generate usage.
Expand Down
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
desc "Build files for packaging"
task :default do
sh 'rst2html README.rst README.html'
sh 'pandoc -t markdown_strict -o README.md README.rst'
sh 'Rscript -e "pkgdown::build_site()"'
end
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.
23 changes: 23 additions & 0 deletions man/figures/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions raw-data/logo.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
library("bittermelon")
library("grid")
library("piecepackr")

font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
font <- read_hex(font_file)
argparse <- as_bm_bitmap("argparse", font = font)
hashbang <- as_bm_bitmap("#!", font = font)

draw_logo <- function() {
hex <- pp_shape("convex6")
grid.newpage()
grid.draw(hex$shape(gp = gpar(col = NA, fill = "gold")))
plot(argparse, col = c("transparent", "black"),
vp = viewport(y = 0.65, width=0.75, height = 0.21))
plot(hashbang, col = c("transparent", "black"),
vp = viewport(y = 0.33, width = 0.5, height = 0.4))
grid.draw(hex$mat(mat_width = 0.03, gp = gpar(col = NA, fill = "black")))
}

w <- 3.0
svg("man/figures/logo.svg", width = w, height = w, bg = "transparent")
draw_logo()
dev.off()

png("man/figures/logo.png", width = w, height = w, units = "in",
res = 72, bg = "transparent")
draw_logo()
dev.off()

0 comments on commit 45854ee

Please sign in to comment.