Learn R Programming

asciicast (version 1.0.0)

record: Record an asciinema screencast

Description

Record an asciinema screencast

Usage

record(
  script,
  typing_speed = NULL,
  empty_wait = NULL,
  cols = NULL,
  rows = NULL,
  title = NULL,
  timestamp = NULL,
  env = NULL,
  idle_time_limit = NULL,
  allow_errors = TRUE,
  timeout = NULL,
  start_wait = NULL,
  end_wait = NULL,
  record_env = NULL,
  startup = NULL,
  echo = TRUE,
  process = NULL
)

Arguments

script

Path of an R script to record. It can also be a readable R connection or URL, as it is passed to base::readLines().

typing_speed

Average typing speed, per keypress, in seconds.

empty_wait

How long to wait for empty lines in the script file, in seconds.

cols

Width of the terminal, in number of characters.

rows

Height of the terminal, in number of characters. If it the string "auto", then it will be determined automatically, by including all output on the screen.

title

Title of the cast, this is included in the cast JSON file.

timestamp

Time stamp of the recording, defaults to Sys.time(), this is included in the cast JSON file.

env

Environment variables to include in the case JSON file. Defaults to list(TERM = "xterm-256color", SHELL = "/bin/zsh").

idle_time_limit

Time limit for the cast not printing anything, in seconds. By default there is no limit.

allow_errors

Whether to cast errors properly. If this is set to TRUE, then asciicast overwrites the "error" option. Only change this if you know what you are doing.

timeout

Idle timeout, in seconds If the R subprocess running the recording does not answer within this limit, it is killed and the recording stops. Update this for slow running code, that produces no output as it runs.

start_wait

Delay at the beginning, in seconds.

end_wait

Delay at the very end, in seconds.

record_env

Environment variables to set for the R subprocess.

startup

Quoted language object to run in the subprocess before starting the recording.

echo

Whether to echo the input to the terminal. If FALSE, then only the output is shown.

process

A processx subprocess to run the cast in. By default a new subprocess is started. You can reuse a process by calling asciicast_start_process() first, and supplying the returned process here.

Value

An asciicast object, write this to file with write_json().

See Also

Other asciicast functions: asciicast-package, asciicast_start_process(), read_cast(), write_json()

Examples

Run this code
# NOT RUN {
script <- system.file("examples", "hello.R", package = "asciicast")
cast <- record(script)
play(cast)
# }

Run the code above in your browser using DataLab