Closed christopherkenny closed 1 year ago
Wow great job, Christopher! I am ready to merge when you are! I'll answer the near term items below:
ThemePark
Theme Park
(if spaces are allowed)ggplot
themes that mirror works from popular culture, such as Barbie, Star Wars, Game of Thrones, etc. The package currently holds N themes and a number of corresponding discrete color scales, palettes, and fonts. Each theme (e.g., theme_barbie
) generates a unique color scheme and font for a ggplot
object that matches the color scheme and font found in the movie, tv show, video game. Colors point is resolved. Good to merge by me.
This PR restructures
theme_park
into an R package. It does a lot, so happy to chat over details before any merging. Primary changes are listed below.These files are generated by default as part of initializing an R package with
devtools::create()
DESCRIPTION
, which contains the key details of the package, like name and licensing. Some details here will need to be drafted and added, like a title (can't just be the same as the short name) and a description (must be a few sentences describing the package).themepark.Rproj
.Rbuildignore
, a listing of files for R's package building to ignore, similar to a.gitignore
fileNAMESPACE
, a file that lists out exports and importsThe next big bucket of changes is moving the
.R
files into theR/
folder so that the package knows what to use.README.Rmd
.On the topic of
README.Rmd
, many packages use that now as it will let you put examples in the readme without doing anything crazy.devtools
automatically includes a pre-hook commit that tries to makes sure you're editing in the right place (the.Rmd
rather than the.md
)With the basic structure, we can then start adding package content.
require()
, these are now in the Descriptionman/
foldertheme_template.R
file outside of the R folder, as it is something we want to be able to use as a resource but is not valid R code. (In theory, we could also just Rbuildignore it, but making it an explicit resource is helpful later on).Then beyond moving out of the R folder, we need to make a series of changes to the existing R folder
utils.R
file. (this can be renamed to anything you prefer.)showtext
part into onLoad inzzz.R
XXXX_font
is TRUEinitialize_font
source code inutils.R
Finally, in utils.R, I've added
new_theme_park_theme()
which makes use of the template to create a new theme. This can be edited to add in any new constraints or checks.Some near-term action items
themepark
since underscores can't be included. This can be changed, for example totheme.park
orthemePark
depending on your preferencespkgname: Title
nemo
orgodfather
and then has named entries within. See #18 for discussion.Some later action items
usethis::use_github_action_check_standard()
to init the GitHub action checkingusethis::use_pkgdown_github_pages()
to give a default pkgdown siteusethis::use_testthat()