Просмотр исходного кода

v0.4.3 (#81)

* 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>
tags/v0.4.3
Garrick Aden-Buie 1 год назад
Родитель
Сommit
2d981e144e
Аккаунт пользователя с таким Email не найден
19 измененных файлов: 40 добавлений и 28 удалений
  1. +1
    -1
      .gitignore
  2. +1
    -1
      DESCRIPTION
  3. +2
    -0
      NAMESPACE
  4. +1
    -1
      NEWS.md
  5. +0
    -1
      R/ggplot2.R
  6. +1
    -1
      R/style_extra_css.R
  7. +2
    -1
      R/style_font_default.R
  8. +2
    -1
      R/utils.R
  9. +1
    -1
      README.Rmd
  10. +2
    -2
      README.md
  11. +5
    -0
      cran-comments.md
  12. +2
    -4
      index.md
  13. +3
    -3
      man/fragments/_thanks.Rmd
  14. +9
    -0
      tests/testthat/_snaps/utils.md
  15. +1
    -1
      tests/testthat/test-ggplot2.R
  16. +0
    -1
      tests/testthat/test-helpers.R
  17. +0
    -1
      tests/testthat/test-style_xaringan.R
  18. +0
    -1
      tests/testthat/test-themes.R
  19. +7
    -7
      vignettes/ggplot2-themes.Rmd

+ 1
- 1
.gitignore Просмотреть файл

@@ -13,7 +13,7 @@ README.html
.history/

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

## https://github.com/github/gitignore/blob/master/R.gitignore
# History files

+ 1
- 1
DESCRIPTION Просмотреть файл

@@ -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"))

+ 2
- 0
NAMESPACE Просмотреть файл

@@ -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)

+ 1
- 1
NEWS.md Просмотреть файл

@@ -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).


+ 0
- 1
R/ggplot2.R Просмотреть файл

@@ -1,4 +1,3 @@

#' A Plot Theme for ggplot2 by xaringanthemer
#'
#' @description

+ 1
- 1
R/style_extra_css.R Просмотреть файл

@@ -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"))'

+ 2
- 1
R/style_font_default.R Просмотреть файл

@@ -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))
}

+ 2
- 1
R/utils.R Просмотреть файл

@@ -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,

+ 1
- 1
README.Rmd Просмотреть файл

@@ -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"}

+ 2
- 2
README.md Просмотреть файл

@@ -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
@@ -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
- 0
cran-comments.md Просмотреть файл

@@ -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.

+ 2
- 4
index.md Просмотреть файл

@@ -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" />

@@ -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)

+ 3
- 3
man/fragments/_thanks.Rmd Просмотреть файл

@@ -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
- 0
tests/testthat/_snaps/utils.md Просмотреть файл

@@ -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


+ 1
- 1
tests/testthat/test-ggplot2.R Просмотреть файл

@@ -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()", {

+ 0
- 1
tests/testthat/test-helpers.R Просмотреть файл

@@ -1,4 +1,3 @@

test_that("element_description", {
text_in <- c("multiple", NA, "", ".remark-slide-content", "h1", "pre, code")
text_out <- c(

+ 0
- 1
tests/testthat/test-style_xaringan.R Просмотреть файл

@@ -1,4 +1,3 @@

test_that("style_xaringan() writes to specified outfile", {
tmpfile <- tempfile(fileext = ".css")
expect_equal(style_xaringan(outfile = tmpfile), tmpfile)

+ 0
- 1
tests/testthat/test-themes.R Просмотреть файл

@@ -1,4 +1,3 @@

test_theme_file <- function(theme = "duo", theme_file = paste0(theme, ".css"), ...) {
local_edition(2)
on.exit(local_edition(3))

+ 7
- 7
vignettes/ggplot2-themes.Rmd Просмотреть файл

@@ -12,7 +12,7 @@ knitr::opts_chunk$set(
collapse = TRUE,
warning = FALSE,
comment = "#>",
fig.width = 6,
fig.width = 6,
fig.height = 4
)
```
@@ -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")

@@ -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()
@@ -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"
)


Загрузка…
Отмена
Сохранить