knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", asciicast_at = "all", asciicast_theme = if (Sys.getenv("IN_PKGDOWN") == "true") "pkgdown" else "readme" ) asciicast::init_knitr_engine()
Turn R scripts into terminal screencasts
asciicast takes an R script and turns it into an asciinema cast. It can simulate typing, and records all terminal output in real time as it happens.
asciicast-demo
vignette.inst/examples
or the README.Rmd
source of the README
file you are reading.You can install the released version of asciicast from CRAN:
install.packages("asciicast")
See the inst/examples
directory
for these examples.
The input script:
The result:
```{asciicast, code = readLines("inst/examples/hello.R"), cache = TRUE}
### Asciicast demo in asciicast Input script that uses asciicast itself: ```r
```{asciicast, code = readLines("inst/examples/asciicast.R"), cache = TRUE}
### Errors are recorded Input script with errors: ```r
{asciicast, code = readLines("inst/examples/errors.R"), cache = TRUE}
MIT @ RStudio
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.