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

Update Readme to show primary args of theme functions

tags/v0.1.1
Garrick Aden-Buie 8 лет назад
Родитель
Сommit
473c38f839
2 измененных файлов: 87 добавлений и 2 удалений
  1. +48
    -0
      README.Rmd
  2. +39
    -2
      README.md

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

@@ -7,6 +7,8 @@ output: github_document
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
results = "asis",
echo = FALSE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
@@ -82,24 +84,50 @@ Use these functions to automatically create a consistent color palette for your

A light theme based around a single color.

```{r mono_light}
demo_function_call <- function(f, n_params = 1) {
cat(sep = "",
"```r\n",
paste(substitute(f)), "(",
if (n_params > 0) paste(collapse = ", ",
sapply(1:n_params, function(i) {
paste0(names(formals(f))[i], ' = "', formals(f)[[i]], '"')})),
")\n```"
)
}
demo_function_call(mono_light, 1)
```

![](docs/example_mono_light.png)

#### `mono_dark()`

A dark theme based around a single color.

```{r mono_dark}
demo_function_call(mono_dark, 1)
```

![](docs/example_mono_dark.png)

#### `mono_accent()`

The default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).

```{r mono_accent}
demo_function_call(mono_accent, 1)
```

![](docs/example_mono_accent.png)

#### `mono_accent_inverse()`

An "inverted" default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).

```{r mono_accent_inverse}
demo_function_call(mono_accent_inverse, 1)
```

![](docs/example_mono_accent_inverse.png)

@@ -111,18 +139,30 @@ These themes build from two (ideally) complementary colors.

A two-colored theme based on a primary and secondary color.

```{r duo}
demo_function_call(duo, 2)
```

![](docs/example_duo.png)

#### `duo_accent()`

The default Xaringan theme with two accent colors.

```{r duo_accent}
demo_function_call(duo_accent, 2)
```

![](docs/example_duo_accent.png)

#### `duo_accent_inverse()`

An "inverted" default Xaringan theme with two accent colors.

```{r duo_accent_inverse}
demo_function_call(duo_accent_inverse, 2)
```

![](docs/example_duo_accent_inverse.png)

### Solarized
@@ -132,10 +172,18 @@ For both themes, it is advisted to change the syntax highlighting theme to `sola

#### `solarized_light()`

```{r solarized_light}
demo_function_call(solarized_light, 0)
```

![](docs/example_solarized_light.png)

#### `solarized_dark()`

```{r solarized_dark}
demo_function_call(solarized_dark, 0)
```

![](docs/example_solarized_dark.png)



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

@@ -81,12 +81,20 @@ for your slides, based around a single color.

A light theme based around a single color.

``` r
mono_light(base_color = "#23395b")
```

![](docs/example_mono_light.png)

#### `mono_dark()`

A dark theme based around a single color.

``` r
mono_dark(base_color = "#cbf7ed")
```

![](docs/example_mono_dark.png)

#### `mono_accent()`
@@ -94,6 +102,10 @@ A dark theme based around a single color.
The default xaringan theme with a single color used for color accents on
select elements (headers, bold text, etc.).

``` r
mono_accent(base_color = "#43418A")
```

![](docs/example_mono_accent.png)

#### `mono_accent_inverse()`
@@ -101,6 +113,10 @@ select elements (headers, bold text, etc.).
An “inverted” default xaringan theme with a single color used for color
accents on select elements (headers, bold text, etc.).

``` r
mono_accent_inverse(base_color = "#3C989E")
```

![](docs/example_mono_accent_inverse.png)

### Duotone
@@ -111,17 +127,30 @@ These themes build from two (ideally) complementary colors.

A two-colored theme based on a primary and secondary color.

``` r
duo(primary_color = "#1F4257", secondary_color = "#F97B64")
```

![](docs/example_duo.png)

#### `duo_accent()`

The default Xaringan theme with two accent colors.

``` r
duo_accent(primary_color = "#006747", secondary_color = "#CFC493")
```

![](docs/example_duo_accent.png)

#### `duo_accent_inverse()`

An “inverted” default Xaringan theme with two accent colors.
An “inverted” default Xaringan theme with two accent
colors.

``` r
duo_accent_inverse(primary_color = "#006747", secondary_color = "#CFC493")
```

![](docs/example_duo_accent_inverse.png)

@@ -135,10 +164,18 @@ paired or constrasted).

#### `solarized_light()`

``` r
solarized_light()
```

![](docs/example_solarized_light.png)

#### `solarized_dark()`

``` r
solarized_dark()
```

![](docs/example_solarized_dark.png)

To do this, your YAML header should look more-or-less like this:
@@ -178,7 +215,7 @@ Here are some of the `text_` theme options:
- `text_color`
- `text_bold_color`
- `text_slide_number_color`
- `text_size`
- `text_font_size`
- `text_slide_number_font_size`
- *and more …*


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