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

asciicast

Turn R scripts into terminal screencasts

Lifecycle: experimental CRAN status Codecov test coverage R-CMD-check

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.

Features

Limitations

Installation

You can install the released version of asciicast from CRAN:

install.packages("asciicast")

Examples

See the inst/examples directory for these examples.

Hello world

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}

Related tools

License

MIT @ RStudio



r-lib/asciicast documentation built on Jan. 31, 2024, 1:19 p.m.