Parcourir la source

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 il y a 1 an
Parent
révision
2d981e144e
Aucun compte lié à l'adresse e-mail de l'auteur
19 fichiers modifiés avec 40 ajouts et 28 suppressions
  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 Voir le fichier

.history/ .history/


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


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

+ 1
- 1
DESCRIPTION Voir le fichier

Type: Package Type: Package
Package: xaringanthemer Package: xaringanthemer
Title: Custom 'xaringan' CSS Themes Title: Custom 'xaringan' CSS Themes
Version: 0.4.2.9000
Version: 0.4.3
Authors@R: Authors@R:
person("Garrick", "Aden-Buie", , "garrick@adenbuie.com", role = c("aut", "cre"), person("Garrick", "Aden-Buie", , "garrick@adenbuie.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7111-0077")) comment = c(ORCID = "0000-0002-7111-0077"))

+ 2
- 0
NAMESPACE Voir le fichier

# Generated by roxygen2: do not edit by hand # Generated by roxygen2: do not edit by hand


S3method(print,google_font)
S3method(print,xaringanthemer_default)
export(apply_alpha) export(apply_alpha)
export(choose_dark_or_light) export(choose_dark_or_light)
export(darken_color) export(darken_color)

+ 1
- 1
NEWS.md Voir le fichier

# xaringanthemer (development version)
# xaringanthemer 0.4.3


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



+ 0
- 1
R/ggplot2.R Voir le fichier


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

+ 1
- 1
R/style_extra_css.R Voir le fichier

if (is.null(names(css))) { if (is.null(names(css))) {
stop("All elements in `css` list must be named", call. = FALSE) 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( stop(str_wrap(
"`css` list must be a named list within a named list, e.g.:\n", "`css` list must be a named list within a named list, e.g.:\n",
' list(".class-id" = list("css-property" = "value"))' ' list(".class-id" = list("css-property" = "value"))'

+ 2
- 1
R/style_font_default.R Voir le fichier

x x
} }


print.xaringanthemer_default <- function(x) {
#' @export
print.xaringanthemer_default <- function(x, ...) {
print(unclass(x)) print(unclass(x))
} }

+ 2
- 1
R/utils.R Voir le fichier

unique(match.arg(language_codes, several.ok = TRUE)) unique(match.arg(language_codes, several.ok = TRUE))
} }


print.google_font <- function(x) {
#' @export
print.google_font <- function(x, ...) {
cat( cat(
"Family: ", "Family: ",
x$family, x$family,

+ 1
- 1
README.Rmd Voir le fichier

[![xaringanthemer status badge](https://gadenbuie.r-universe.dev/badges/xaringanthemer)](https://gadenbuie.r-universe.dev) [![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) [![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) [![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 --> <!-- badges: end -->


```{r child="man/fragments/_tagline-gif.Rmd"} ```{r child="man/fragments/_tagline-gif.Rmd"}

+ 2
- 2
README.md Voir le fichier

stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html) stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![R-CMD-Check status [![R-CMD-Check status
badge](https://github.com/gadenbuie/xaringanthemer/workflows/R-CMD-check/badge.svg?branch=main)](https://github.com/gadenbuie/xaringanthemer/actions) 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 --> <!-- badges: end -->


Give your [xaringan](https://github.com/yihui/xaringan) slides some Give your [xaringan](https://github.com/yihui/xaringan) slides some


## Features ## Features


There’s a lot more that **xaringanthemer** can do\! [Discover
There’s a lot more that **xaringanthemer** can do! [Discover
xaringanthemer’s xaringanthemer’s
features.](https://pkg.garrickadenbuie.com/xaringanthemer/articles/xaringanthemer.html) features.](https://pkg.garrickadenbuie.com/xaringanthemer/articles/xaringanthemer.html)

+ 5
- 0
cran-comments.md Voir le fichier

## 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 Voir le fichier

**xaringanthemer** is <kbd>Tab</kbd> friendly – [use autocomplete to **xaringanthemer** is <kbd>Tab</kbd> friendly – [use autocomplete to
explore](#theme-settings) the [template explore](#theme-settings) the [template
variables](vignettes/template-variables.md) that you can adjust in each 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" /> <img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example-rstudio-completion.gif" alt="Demonstration of argument auto-completion with RStudio" data-external="1" />


Presentation* from the New R Markdown Document menu in RStudio. Presentation* from the New R Markdown Document menu in RStudio.


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


## Features ## Features


There’s a lot more that **xaringanthemer** can do\! [Discover
There’s a lot more that **xaringanthemer** can do! [Discover
xaringanthemer’s xaringanthemer’s
features.](https://pkg.garrickadenbuie.com/xaringanthemer/articles/xaringanthemer.html) features.](https://pkg.garrickadenbuie.com/xaringanthemer/articles/xaringanthemer.html)

+ 3
- 3
man/fragments/_thanks.Rmd Voir le fichier



**xaringanthemer** was built by [Garrick Aden-Buie](https://www.garrickadenbuie.com) ([&commat;grrrck](https://twitter.com/grrrck)). **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! if you find a bug or have a theme suggestion -- or better yet, submit a pull request!

+ 9
- 0
tests/testthat/_snaps/utils.md Voir le fichier

# 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 Voir le fichier

expect_equal(res$after_set$line_colour, "#0088ff") expect_equal(res$after_set$line_colour, "#0088ff")
expect_equal(res$after_set$bar_fill, "#FF8800") expect_equal(res$after_set$bar_fill, "#FF8800")
expect_equal(res$after_restore$line_colour, res$original$colour) 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()", { describe("theme_xaringan_get_value()", {

+ 0
- 1
tests/testthat/test-helpers.R Voir le fichier


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

+ 0
- 1
tests/testthat/test-style_xaringan.R Voir le fichier


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

+ 0
- 1
tests/testthat/test-themes.R Voir le fichier


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

+ 7
- 7
vignettes/ggplot2-themes.Rmd Voir le fichier

collapse = TRUE, collapse = TRUE,
warning = FALSE, warning = FALSE,
comment = "#>", comment = "#>",
fig.width = 6,
fig.width = 6,
fig.height = 4 fig.height = 4
) )
``` ```
```{r ggplot2-demo-1, out.width = "48%", fig.show="hide"} ```{r ggplot2-demo-1, out.width = "48%", fig.show="hide"}
library(ggplot2) library(ggplot2)


g_base <- ggplot(mpg) +
aes(hwy, cty) +
g_base <- ggplot(mpg) +
aes(hwy, cty) +
geom_point() + geom_point() +
labs(x = "Highway MPG", y = "City MPG", title = "Fuel Efficiency") labs(x = "Highway MPG", y = "City MPG", title = "Fuel Efficiency")


- `header_font_google = google_font("Oleo Script")`. - `header_font_google = google_font("Oleo Script")`.


```{r text demo, fig.width = 10} ```{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 = ",")), 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") labs(x = "Cut", y = "Count")


g_diamonds_with_text + theme_xaringan() g_diamonds_with_text + theme_xaringan()
```{r eval=FALSE} ```{r eval=FALSE}
font_url <- file.path( font_url <- file.path(
"https://fontlibrary.org/assets/fonts/glacial-indifference/", "https://fontlibrary.org/assets/fonts/glacial-indifference/",
"5f2cf277506e19ec77729122f27b1faf/0820b3c58fed35de298219f314635982",
"5f2cf277506e19ec77729122f27b1faf/0820b3c58fed35de298219f314635982",
"GlacialIndifferenceRegular.ttf" "GlacialIndifferenceRegular.ttf"
) )



Chargement…
Annuler
Enregistrer