浏览代码

Include xaringanthemer package version in output header

tags/v0.3.0
父节点
当前提交
356c6e5184
共有 15 个文件被更改,包括 58 次插入23 次删除
  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 查看文件

@@ -1,29 +1,36 @@
Package: xaringanthemer
Type: Package
Package: xaringanthemer
Title: Xaringan CSS Theme Generator
Version: 0.2.0.9000
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
URL: https://github.com/gadenbuie/xaringanthemer
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:
purrr,
tibble,
glue,
purrr,
stringr,
tibble,
utils,
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 查看文件

@@ -161,6 +161,8 @@ write_xaringan_theme <- function(
)
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")
template <- readLines(tf, warn = FALSE)
template <- paste(template, collapse = "\n")

+ 2
- 0
inst/resources/template.css 查看文件

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

+ 2
- 0
inst/scripts/write_xaringan_theme_body.R 查看文件

@@ -47,6 +47,8 @@ title_slide_background_size <- title_slide_background_size %||% (
)
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")
template <- readLines(tf, warn = FALSE)
template <- paste(template, collapse = "\n")

+ 5
- 4
man/xaringanthemer-package.Rd 查看文件

@@ -6,9 +6,10 @@
\alias{xaringanthemer-package}
\title{xaringanthemer: Xaringan CSS Theme Generator}
\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{
Useful links:
@@ -19,7 +20,7 @@ Useful links:

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

}
\keyword{internal}

+ 2
- 0
tests/testthat/css/duo.css 查看文件

@@ -15,6 +15,8 @@
* - xaringan wiki: https://github.com/yihui/xaringan/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=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/duo_accent.css 查看文件

@@ -15,6 +15,8 @@
* - xaringan wiki: https://github.com/yihui/xaringan/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=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/duo_accent_inverse.css 查看文件

@@ -15,6 +15,8 @@
* - xaringan wiki: https://github.com/yihui/xaringan/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=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/mono_accent.css 查看文件

@@ -15,6 +15,8 @@
* - xaringan wiki: https://github.com/yihui/xaringan/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=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/mono_accent_inverse.css 查看文件

@@ -15,6 +15,8 @@
* - xaringan wiki: https://github.com/yihui/xaringan/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=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/mono_dark.css 查看文件

@@ -15,6 +15,8 @@
* - xaringan wiki: https://github.com/yihui/xaringan/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=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/mono_light.css 查看文件

@@ -15,6 +15,8 @@
* - xaringan wiki: https://github.com/yihui/xaringan/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=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/solarized_dark.css 查看文件

@@ -15,6 +15,8 @@
* - xaringan wiki: https://github.com/yihui/xaringan/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=Yanone+Kaffeesatz);

+ 2
- 0
tests/testthat/css/solarized_light.css 查看文件

@@ -15,6 +15,8 @@
* - xaringan wiki: https://github.com/yihui/xaringan/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=Yanone+Kaffeesatz);

+ 4
- 1
tests/testthat/test-themes.R 查看文件

@@ -19,7 +19,10 @@ test_theme_file <- function(theme = "duo") {
theme_file <- paste0(theme, ".css")

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


正在加载...
取消
保存