Skip to content

Commit

Permalink
v0.4.3 (#81)
Browse files Browse the repository at this point in the history
* Increment version number to 0.4.3

* chore: add cran comments

* Fix indents and invisible characters (GitHub Actions)

* Re-build README.Rmd (GitHub Actions)

* Re-build index.Rmd (GitHub Actions)

* chore: urlchecker::url_update()

* chore: align and register s3 print methods

* tests: Update and fix tests

* docs: update link in thanks

---------

Co-authored-by: gadenbuie <gadenbuie@users.noreply.github.com>
  • Loading branch information
gadenbuie and gadenbuie authored Sep 16, 2024
1 parent fc0ff80 commit 2d981e1
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ README.html
.history/

# Directories that start with _
_*/
/_*/

## https://github.com/github/gitignore/blob/master/R.gitignore
# History files
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: xaringanthemer
Title: Custom 'xaringan' CSS Themes
Version: 0.4.2.9000
Version: 0.4.3
Authors@R:
person("Garrick", "Aden-Buie", , "garrick@adenbuie.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7111-0077"))
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Generated by roxygen2: do not edit by hand

S3method(print,google_font)
S3method(print,xaringanthemer_default)
export(apply_alpha)
export(choose_dark_or_light)
export(darken_color)
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# xaringanthemer (development version)
# xaringanthemer 0.4.3

- Update the spelling of `colour` for compatibility with ggplot2 >= 3.5.1 (@teunbrand #79).

Expand Down
1 change: 0 additions & 1 deletion R/ggplot2.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#' A Plot Theme for ggplot2 by xaringanthemer
#'
#' @description
Expand Down
2 changes: 1 addition & 1 deletion R/style_extra_css.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ list2css <- function(css) {
if (is.null(names(css))) {
stop("All elements in `css` list must be named", call. = FALSE)
}
if (purrr::vec_depth(css) != 3) {
if (purrr::pluck_depth(css) != 3) {
stop(str_wrap(
"`css` list must be a named list within a named list, e.g.:\n",
' list(".class-id" = list("css-property" = "value"))'
Expand Down
3 changes: 2 additions & 1 deletion R/style_font_default.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ xaringanthemer_font_default <- function(font_arg) {
x
}

print.xaringanthemer_default <- function(x) {
#' @export
print.xaringanthemer_default <- function(x, ...) {
print(unclass(x))
}
3 changes: 2 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ google_language_codes <- function(
unique(match.arg(language_codes, several.ok = TRUE))
}

print.google_font <- function(x) {
#' @export
print.google_font <- function(x, ...) {
cat(
"Family: ",
x$family,
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ library(xaringanthemer)
[![xaringanthemer status badge](https://gadenbuie.r-universe.dev/badges/xaringanthemer)](https://gadenbuie.r-universe.dev)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![R-CMD-Check status badge](https://github.com/gadenbuie/xaringanthemer/workflows/R-CMD-check/badge.svg?branch=main)](https://github.com/gadenbuie/xaringanthemer/actions)
[![Codecov](https://img.shields.io/codecov/c/github/gadenbuie/xaringanthemer)](https://codecov.io/github/gadenbuie/xaringanthemer)
[![Codecov](https://img.shields.io/codecov/c/github/gadenbuie/xaringanthemer)](https://app.codecov.io/github/gadenbuie/xaringanthemer)
<!-- badges: end -->

```{r child="man/fragments/_tagline-gif.Rmd"}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ badge](https://gadenbuie.r-universe.dev/badges/xaringanthemer)](https://gadenbui
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![R-CMD-Check status
badge](https://github.com/gadenbuie/xaringanthemer/workflows/R-CMD-check/badge.svg?branch=main)](https://github.com/gadenbuie/xaringanthemer/actions)
[![Codecov](https://img.shields.io/codecov/c/github/gadenbuie/xaringanthemer)](https://codecov.io/github/gadenbuie/xaringanthemer)
[![Codecov](https://img.shields.io/codecov/c/github/gadenbuie/xaringanthemer)](https://app.codecov.io/github/gadenbuie/xaringanthemer)
<!-- badges: end -->

Give your [xaringan](https://github.com/yihui/xaringan) slides some
Expand All @@ -40,6 +40,6 @@ remotes::install_github("gadenbuie/xaringanthemer")

## Features

There’s a lot more that **xaringanthemer** can do\! [Discover
There’s a lot more that **xaringanthemer** can do! [Discover
xaringanthemer’s
features.](https://pkg.garrickadenbuie.com/xaringanthemer/articles/xaringanthemer.html)
5 changes: 5 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## R CMD check results

0 errors | 0 warnings | 0 note

This is a minor maintenance release to address changes in ggplot2.
6 changes: 2 additions & 4 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ ggplot(diamonds) +
**xaringanthemer** is <kbd>Tab</kbd> friendly – [use autocomplete to
explore](#theme-settings) the [template
variables](vignettes/template-variables.md) that you can adjust in each
of the themes\!
of the themes!
<img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example-rstudio-completion.gif" alt="Demonstration of argument auto-completion with RStudio" data-external="1" />
Expand All @@ -113,13 +113,11 @@ You can also skip the above and just create a *Ninja Themed
Presentation* from the New R Markdown Document menu in RStudio.
<center>
<img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/rmarkdown-template-screenshot.png" alt="The 'New R Markdown Document' menu in RStudio" data-external="1" />
</center>
## Features
There’s a lot more that **xaringanthemer** can do\! [Discover
There’s a lot more that **xaringanthemer** can do! [Discover
xaringanthemer’s
features.](https://pkg.garrickadenbuie.com/xaringanthemer/articles/xaringanthemer.html)
6 changes: 3 additions & 3 deletions man/fragments/_thanks.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

**xaringanthemer** was built by [Garrick Aden-Buie](https://www.garrickadenbuie.com) ([&commat;grrrck](https://twitter.com/grrrck)).

Big thank you to [Yihui Xie](https://yihui.org), especially for [xaringan].
Also thanks to [Ole Petter Bang](http://www.gnab.org/) for [remark.js][remarkjs].
Big thank you to [Yihui Xie](https://yihui.org/), especially for [xaringan].
Also thanks to [Ole Petter Bang](https://gnab.org/) for [remark.js][remarkjs].

Feel free to [file an issue](https://github.com/gadenbuie/xaringanthemer/issues)
Feel free to [file an issue](https://github.com/gadenbuie/xaringanthemer/issues)
if you find a bug or have a theme suggestion -- or better yet, submit a pull request!
9 changes: 9 additions & 0 deletions tests/testthat/_snaps/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# printing google_font works

Code
google_font("Josefin Sans", "400", "400i", "600i", "700")
Output
Family: Josefin Sans
Weights: 400,400i,600i,700
URL: https://fonts.googleapis.com/css?family=Josefin+Sans:400,400i,600i,700&display=swap

2 changes: 1 addition & 1 deletion tests/testthat/test-ggplot2.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ test_that("theme_xaringan_restore_defaults() restores defaults", {
expect_equal(res$after_set$line_colour, "#0088ff")
expect_equal(res$after_set$bar_fill, "#FF8800")
expect_equal(res$after_restore$line_colour, res$original$colour)
expect_equal(res$after_restore$bar_fill, res$original$fil)
expect_equal(res$after_restore$bar_fill, res$original$fill)
})

describe("theme_xaringan_get_value()", {
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-helpers.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

test_that("element_description", {
text_in <- c("multiple", NA, "", ".remark-slide-content", "h1", "pre, code")
text_out <- c(
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-style_xaringan.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

test_that("style_xaringan() writes to specified outfile", {
tmpfile <- tempfile(fileext = ".css")
expect_equal(style_xaringan(outfile = tmpfile), tmpfile)
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-themes.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

test_theme_file <- function(theme = "duo", theme_file = paste0(theme, ".css"), ...) {
local_edition(2)
on.exit(local_edition(3))
Expand Down
14 changes: 7 additions & 7 deletions vignettes/ggplot2-themes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ knitr::opts_chunk$set(
collapse = TRUE,
warning = FALSE,
comment = "#>",
fig.width = 6,
fig.width = 6,
fig.height = 4
)
```
Expand Down Expand Up @@ -100,8 +100,8 @@ changes the colors and fonts of your plot theme.
```{r ggplot2-demo-1, out.width = "48%", fig.show="hide"}
library(ggplot2)
g_base <- ggplot(mpg) +
aes(hwy, cty) +
g_base <- ggplot(mpg) +
aes(hwy, cty) +
geom_point() +
labs(x = "Highway MPG", y = "City MPG", title = "Fuel Efficiency")
Expand Down Expand Up @@ -285,10 +285,10 @@ In our demo theme, we used `style_mono_accent()` with
- `header_font_google = google_font("Oleo Script")`.

```{r text demo, fig.width = 10}
g_diamonds_with_text <-
g_diamonds +
g_diamonds_with_text <-
g_diamonds +
geom_text(aes(y = ..count.., label = format(..count.., big.mark = ",")),
vjust = -0.30, size = 8, stat = "count") +
vjust = -0.30, size = 8, stat = "count") +
labs(x = "Cut", y = "Count")
g_diamonds_with_text + theme_xaringan()
Expand Down Expand Up @@ -346,7 +346,7 @@ in the xaringanthemer package.
```{r eval=FALSE}
font_url <- file.path(
"https://fontlibrary.org/assets/fonts/glacial-indifference/",
"5f2cf277506e19ec77729122f27b1faf/0820b3c58fed35de298219f314635982",
"5f2cf277506e19ec77729122f27b1faf/0820b3c58fed35de298219f314635982",
"GlacialIndifferenceRegular.ttf"
)
Expand Down

0 comments on commit 2d981e1

Please sign in to comment.