Bladeren bron

Include xaringanthemer package version in output header

tags/v0.3.0
Garrick Aden-Buie 7 jaren geleden
bovenliggende
commit
356c6e5184
15 gewijzigde bestanden met toevoegingen van 58 en 23 verwijderingen
  1. +25
    -18
      DESCRIPTION
  2. +2
    -0
      R/write_theme.R
  3. +2
    -0
      inst/resources/template.css
  4. +2
    -0
      inst/scripts/write_xaringan_theme_body.R
  5. +5
    -4
      man/xaringanthemer-package.Rd
  6. +2
    -0
      tests/testthat/css/duo.css
  7. +2
    -0
      tests/testthat/css/duo_accent.css
  8. +2
    -0
      tests/testthat/css/duo_accent_inverse.css
  9. +2
    -0
      tests/testthat/css/mono_accent.css
  10. +2
    -0
      tests/testthat/css/mono_accent_inverse.css
  11. +2
    -0
      tests/testthat/css/mono_dark.css
  12. +2
    -0
      tests/testthat/css/mono_light.css
  13. +2
    -0
      tests/testthat/css/solarized_dark.css
  14. +2
    -0
      tests/testthat/css/solarized_light.css
  15. +4
    -1
      tests/testthat/test-themes.R

+ 25
- 18
DESCRIPTION Bestand weergeven

Package: xaringanthemer
Type: Package Type: Package
Package: xaringanthemer
Title: Xaringan CSS Theme Generator Title: Xaringan CSS Theme Generator
Version: 0.2.0.9000 Version: 0.2.0.9000
Date: 2018-04-16 Date: 2018-04-16
Authors@R: person("Garrick", "Aden-Buie", email = "g.adenbuie@gmail.com", role = c("aut", "cre"))
Description: Create and edit your xaringan CSS files from within your R
R Markdown slide source. More technically, this package actually creates
valid remarkjs CSS themes that are easily used by xarangan.
Authors@R:
person(given = "Garrick",
family = "Aden-Buie",
role = c("aut", "cre"),
email = "garrick@adenbuie.com")
Description: Create and edit your xaringan CSS files from within
your R R Markdown slide source. More technically, this package
actually creates valid remarkjs CSS themes that are easily used by
xarangan.
License: MIT + file LICENSE License: MIT + file LICENSE
URL: https://github.com/gadenbuie/xaringanthemer URL: https://github.com/gadenbuie/xaringanthemer
BugReports: https://github.com/gadenbuie/xaringanthemer/issues BugReports: https://github.com/gadenbuie/xaringanthemer/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
Roxygen: list(markdown = TRUE)
Suggests:
testthat,
xaringan,
here,
knitr,
rmarkdown
Imports: Imports:
purrr,
tibble,
glue, glue,
purrr,
stringr, stringr,
tibble,
utils,
whisker whisker
VignetteBuilder: knitr
Suggests:
here,
knitr,
rmarkdown,
testthat,
xaringan
VignetteBuilder:
knitr
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 6.1.1

+ 2
- 0
R/write_theme.R Bestand weergeven

) )
table_row_even_background_color <- table_row_even_background_color %||% background_color table_row_even_background_color <- table_row_even_background_color %||% background_color
xaringanthemer_version <- utils::packageVersion("xaringanthemer")
tf <- system.file("resources", "template.css", package = "xaringanthemer") tf <- system.file("resources", "template.css", package = "xaringanthemer")
template <- readLines(tf, warn = FALSE) template <- readLines(tf, warn = FALSE)
template <- paste(template, collapse = "\n") template <- paste(template, collapse = "\n")

+ 2
- 0
inst/resources/template.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
{{#xaringanthemer_version}} * Version: {{xaringanthemer_version}}{{/xaringanthemer_version}}
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url({{text_font_url}}); @import url({{text_font_url}});
@import url({{header_font_url}}); @import url({{header_font_url}});

+ 2
- 0
inst/scripts/write_xaringan_theme_body.R Bestand weergeven

) )
table_row_even_background_color <- table_row_even_background_color %||% background_color table_row_even_background_color <- table_row_even_background_color %||% background_color


xaringanthemer_version <- utils::packageVersion("xaringanthemer")

tf <- system.file("resources", "template.css", package = "xaringanthemer") tf <- system.file("resources", "template.css", package = "xaringanthemer")
template <- readLines(tf, warn = FALSE) template <- readLines(tf, warn = FALSE)
template <- paste(template, collapse = "\n") template <- paste(template, collapse = "\n")

+ 5
- 4
man/xaringanthemer-package.Rd Bestand weergeven

\alias{xaringanthemer-package} \alias{xaringanthemer-package}
\title{xaringanthemer: Xaringan CSS Theme Generator} \title{xaringanthemer: Xaringan CSS Theme Generator}
\description{ \description{
Create and edit your xaringan CSS files from within your R
R Markdown slide source. More technically, this package actually creates
valid remarkjs CSS themes that are easily used by xarangan.
Create and edit your xaringan CSS files from within
your R R Markdown slide source. More technically, this package
actually creates valid remarkjs CSS themes that are easily used by
xarangan.
} }
\seealso{ \seealso{
Useful links: Useful links:


} }
\author{ \author{
\strong{Maintainer}: Garrick Aden-Buie \email{g.adenbuie@gmail.com}
\strong{Maintainer}: Garrick Aden-Buie \email{garrick@adenbuie.com}


} }
\keyword{internal} \keyword{internal}

+ 2
- 0
tests/testthat/css/duo.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
* Version: a.b.c.d.eeee
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/duo_accent.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
* Version: a.b.c.d.eeee
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/duo_accent_inverse.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
* Version: a.b.c.d.eeee
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/mono_accent.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
* Version: a.b.c.d.eeee
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/mono_accent_inverse.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
* Version: a.b.c.d.eeee
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/mono_dark.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
* Version: a.b.c.d.eeee
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/mono_light.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
* Version: a.b.c.d.eeee
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/solarized_dark.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
* Version: a.b.c.d.eeee
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/solarized_light.css Bestand weergeven

* - xaringan wiki: https://github.com/yihui/xaringan/wiki * - xaringan wiki: https://github.com/yihui/xaringan/wiki
* - remarkjs wiki: https://github.com/gnab/remark/wiki * - remarkjs wiki: https://github.com/gnab/remark/wiki
* *
* Version: a.b.c.d.eeee
*
* ------------------------------------------------------- */ * ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);

+ 4
- 1
tests/testthat/test-themes.R Bestand weergeven

theme_file <- paste0(theme, ".css") theme_file <- paste0(theme, ".css")


theme_fun(outfile = tmpfile) theme_fun(outfile = tmpfile)
theme_css <- paste(readLines(tmpfile), collapse = "\n")
theme_css <- readLines(tmpfile)
# Mask package version in test files
theme_css <- sub("( \\* Version: )[\\d.-]+", "\\1a.b.c.d.eeee", theme_css, perl = TRUE)
theme_css <- paste(theme_css, collapse = "\n")
expect_known_output(cat(theme_css), test_path("css", theme_file)) expect_known_output(cat(theme_css), test_path("css", theme_file))
} }



Laden…
Annuleren
Opslaan