Skip to content

Commit 7c64a26

Browse files
deactivate cache for all vignettes
1 parent d71e2cc commit 7c64a26

File tree

7 files changed

+32
-4
lines changed

7 files changed

+32
-4
lines changed

vignettes/caching.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ knitr::opts_chunk$set(
1212
collapse = TRUE,
1313
comment = "#>"
1414
)
15+
options(styler.colored_print.vertical = FALSE)
16+
styler::cache_deactivate()
1517
```
1618

1719
```{r setup}

vignettes/customizing_styler.Rmd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ vignette: >
77
%\VignetteEncoding{UTF-8}
88
---
99

10+
```{r}
11+
knitr::opts_chunk$set(
12+
collapse = TRUE,
13+
comment = "#>"
14+
)
15+
options(styler.colored_print.vertical = FALSE)
16+
styler::cache_deactivate()
17+
```
18+
1019
This vignette provides a high-level overview of how styler works and how you can define your own style guide and format code according to it. If you simply want to customize the tidyverse style guide to your needs, check out `vignette("styler")`, to remove some rules, have a look at `vignette("remove_rules")`. How to distribute a custom style guide is described in `vignette("distribute_custom_style_guides")`.
1120

1221
# How styler works

vignettes/detect-alignment.Rmd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ vignette: >
88
---
99

1010
```{r, include=FALSE}
11-
knitr::opts_chunk$set(eval = FALSE)
11+
knitr::opts_chunk$set(
12+
eval = FALSE,
13+
collapse = TRUE,
14+
comment = "#>"
15+
)
16+
styler::cache_deactivate()
1217
```
1318

1419
# Overview

vignettes/distribute_custom_style_guides.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ knitr::opts_chunk$set(
1212
collapse = TRUE,
1313
comment = "#>"
1414
)
15+
styler::cache_deactivate()
16+
options(styler.colored_print.vertical = FALSE)
1517
```
1618

1719
This vignette describes how you can distribute your own style guide. It builds on `vignette("customizing_styler")` and assumes you understand how to create a style guide with `create_style_guide()`.

vignettes/remove_rules.Rmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ knitr::opts_chunk$set(
1515
collapse = TRUE,
1616
comment = "#>"
1717
)
18+
styler::cache_deactivate()
1819
```
1920

2021
```{r, echo = FALSE, include = FALSE}
@@ -60,7 +61,9 @@ Here are the steps required to deactivate a rule you don't like
6061
Lets assume you want to remove the rule that turns `=` into `<-` for
6162
assignment. That means you want
6263

63-
string = "hi there"
64+
```
65+
string = "hi there"
66+
```
6467

6568
to remain unchanged after applying styler. This is not the case if you use the
6669
default style guide of styler:

vignettes/strict.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ knitr::opts_chunk$set(
1414
results = "hide"
1515
)
1616
17+
styler::cache_deactivate()
18+
1719
knitr::knit_engines$set(list(
1820
styler = function(options) {
1921
options$comment <- ""

vignettes/styler.Rmd

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ knitr::knit_engines$set(list(
2121
))
2222
2323
options(styler.colored_print.vertical = FALSE)
24+
styler::cache_deactivate()
2425
```
2526

2627
# Entry-points
@@ -35,14 +36,18 @@ styler provides the following API to format code:
3536

3637
- RStudio Addins for styling the active file, styling the current package and styling the highlighted selection, see `help("styler_addins")`.
3738

38-
Beyond that, styler can be used through other tools documented in the `vignette("third-party-integrations")`.
39+
Beyond that, styler can be used through other tools documented in the `vignette("third-party-integrations")`. Let's get started.
40+
```{r}
41+
library(styler)
42+
```
43+
44+
3945

4046
### Passing arguments to the style guide
4147

4248
styler separates the abstract definition of a style guide from the application of it. That's why you must supply a style guide via `transformers` when styling (in case you don't want to rely on the defaults):
4349

4450
```{r}
45-
library(styler)
4651
style_text("a + b", transformers = tidyverse_style(scope = "indention"))
4752
```
4853

0 commit comments

Comments
 (0)