| @@ -13,6 +13,7 @@ knitr::opts_chunk$set( | |||
| fig.path = "man/figures/README-", | |||
| out.width = "100%" | |||
| ) | |||
| IS_README <- TRUE | |||
| library(xaringanthemer) | |||
| ``` | |||
| # xaringanthemer | |||
| @@ -139,3 +140,7 @@ Using the above example, we could color text red `.red[like this]` or write `.sm | |||
| ```{r child="vignettes/rmdchunks/_thanks.Rmd"} | |||
| ``` | |||
| ```{r include=FALSE} | |||
| rm("IS_README") | |||
| ``` | |||
| @@ -8,7 +8,7 @@ style with **xaringanthemer** within your `slides.Rmd` file without | |||
| (much) | |||
| CSS. | |||
| <img src="vignettes/images/examples.gif" width="100%" /> | |||
| <img src="/Users/garrickaden-buie/Dropbox/R/xaringanthemer/vignettes/images/examples.gif" width="100%" /> | |||
| - [Installation](#installation) | |||
| - [Quick Intro](#quick-intro) | |||
| @@ -22,7 +22,7 @@ CSS. | |||
| ## Installation | |||
| **xaringanthemer** lives here on GitHub. | |||
| **xaringanthemer** currently lives on GitHub. | |||
| ``` r | |||
| # install.packages("devtools") | |||
| @@ -70,7 +70,7 @@ themes\! | |||
| <center> | |||
| <img src="vignettes/images/rmarkdown-template-screenshot.png" width="350px" /> | |||
| <img src="/Users/garrickaden-buie/Dropbox/R/xaringanthemer/vignettes/images/rmarkdown-template-screenshot.png" width="350px" /> | |||
| </center> | |||
| @@ -86,8 +86,7 @@ for your slides, based around a single color. | |||
| #### `mono_light()` | |||
| A light theme based around a single | |||
| color. | |||
| A light theme based around a single color. | |||
| ``` r | |||
| mono_light(base_color = "#23395b") | |||
| @@ -97,8 +96,7 @@ mono_light(base_color = "#23395b") | |||
| #### `mono_dark()` | |||
| A dark theme based around a single | |||
| color. | |||
| A dark theme based around a single color. | |||
| ``` r | |||
| mono_dark(base_color = "#cbf7ed") | |||
| @@ -109,8 +107,7 @@ mono_dark(base_color = "#cbf7ed") | |||
| #### `mono_accent()` | |||
| The default xaringan theme with a single color used for color accents on | |||
| select elements (headers, bold text, | |||
| etc.). | |||
| select elements (headers, bold text, etc.). | |||
| ``` r | |||
| mono_accent(base_color = "#43418A") | |||
| @@ -136,8 +133,7 @@ These themes build from two (ideally) complementary colors. | |||
| #### `duo()` | |||
| A two-colored theme based on a primary and secondary | |||
| color. | |||
| A two-colored theme based on a primary and secondary color. | |||
| ``` r | |||
| duo(primary_color = "#1F4257", secondary_color = "#F97B64") | |||
| @@ -147,8 +143,7 @@ duo(primary_color = "#1F4257", secondary_color = "#F97B64") | |||
| #### `duo_accent()` | |||
| The default Xaringan theme with two accent | |||
| colors. | |||
| The default Xaringan theme with two accent colors. | |||
| ``` r | |||
| duo_accent(primary_color = "#006747", secondary_color = "#CFC493") | |||
| @@ -173,8 +168,7 @@ There are also two themes based around the [solarized color | |||
| palette](http://ethanschoonover.com/solarized), `solarized_light()` and | |||
| `solarized_dark()`. For both themes, it is advisted to change the syntax | |||
| highlighting theme to `solarized-light` or `solarized-dark` (looks great | |||
| paired or | |||
| constrasted). | |||
| paired or constrasted). | |||
| #### `solarized_light()` | |||
| @@ -1,4 +1,4 @@ | |||
| **xaringanthemer** lives here on GitHub. | |||
| **xaringanthemer** currently lives on GitHub. | |||
| ```r | |||
| # install.packages("devtools") | |||
| @@ -25,7 +25,13 @@ mono_light( | |||
| ``` | |||
| ```` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_mono_light_1c5253.png"))` | |||
| ```{r echo=FALSE} | |||
| if (exists('IS_README') && IS_README) { | |||
| knitr::include_graphics("vignettes/images/example_mono_light_1c5253.png") | |||
| } else { | |||
| knitr::include_graphics(here::here("vignettes/images/example_mono_light_1c5253.png")) | |||
| } | |||
| ``` | |||
| **xaringanthemer** is <kbd>Tab</kbd> friendly -- [use autocomplete to explore][theme-settings] the [template variables][template-variables] that you can adjust in each of the themes! | |||
| @@ -1,5 +1,13 @@ | |||
| ### Monotone | |||
| ```{r include=FALSE} | |||
| IS_README <- exists("IS_README") && IS_README | |||
| include_graphic <- function(img_path, is_readme = IS_README) { | |||
| if (is_readme) knitr::include_graphics(img_path) | |||
| else knitr::include_graphics(here::here(img_path)) | |||
| } | |||
| ``` | |||
| Use these functions to automatically create a consistent color palette for your slides, based around a single color. | |||
| #### `mono_light()` | |||
| @@ -20,7 +28,7 @@ demo_function_call <- function(f, n_params = 1) { | |||
| demo_function_call(mono_light, 1) | |||
| ``` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_mono_light.png"))` | |||
| `r include_graphic("vignettes/images/example_mono_light.png")` | |||
| #### `mono_dark()` | |||
| @@ -30,7 +38,7 @@ A dark theme based around a single color. | |||
| demo_function_call(mono_dark, 1) | |||
| ``` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_mono_dark.png"))` | |||
| `r include_graphic("vignettes/images/example_mono_dark.png")` | |||
| #### `mono_accent()` | |||
| @@ -40,7 +48,7 @@ The default xaringan theme with a single color used for color accents on select | |||
| demo_function_call(mono_accent, 1) | |||
| ``` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_mono_accent.png"))` | |||
| `r include_graphic("vignettes/images/example_mono_accent.png")` | |||
| #### `mono_accent_inverse()` | |||
| @@ -50,7 +58,7 @@ An "inverted" default xaringan theme with a single color used for color accents | |||
| demo_function_call(mono_accent_inverse, 1) | |||
| ``` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_mono_accent_inverse.png"))` | |||
| `r include_graphic("vignettes/images/example_mono_accent_inverse.png")` | |||
| ### Duotone | |||
| @@ -65,7 +73,7 @@ A two-colored theme based on a primary and secondary color. | |||
| demo_function_call(duo, 2) | |||
| ``` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_duo.png"))` | |||
| `r include_graphic("vignettes/images/example_duo.png")` | |||
| #### `duo_accent()` | |||
| @@ -75,7 +83,7 @@ The default Xaringan theme with two accent colors. | |||
| demo_function_call(duo_accent, 2) | |||
| ``` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_duo_accent.png"))` | |||
| `r include_graphic("vignettes/images/example_duo_accent.png")` | |||
| #### `duo_accent_inverse()` | |||
| @@ -85,7 +93,7 @@ An "inverted" default Xaringan theme with two accent colors. | |||
| demo_function_call(duo_accent_inverse, 2) | |||
| ``` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_duo_accent_inverse.png"))` | |||
| `r include_graphic("vignettes/images/example_duo_accent_inverse.png")` | |||
| ### Solarized | |||
| @@ -98,7 +106,7 @@ For both themes, it is advisted to change the syntax highlighting theme to `sola | |||
| demo_function_call(solarized_light, 0) | |||
| ``` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_solarized_light.png"))` | |||
| `r include_graphic("vignettes/images/example_solarized_light.png")` | |||
| #### `solarized_dark()` | |||
| @@ -106,7 +114,7 @@ demo_function_call(solarized_light, 0) | |||
| demo_function_call(solarized_dark, 0) | |||
| ``` | |||
| `r knitr::include_graphics(here::here("vignettes/images/example_solarized_dark.png"))` | |||
| `r include_graphic("vignettes/images/example_solarized_dark.png")` | |||
| To do this, your YAML header should look more-or-less like this: | |||