Record an asciinema screencast
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
)
Path of an R script to record. It can also be a readable
R connection or URL, as it is passed to base::readLines()
.
Average typing speed, per keypress, in seconds.
How long to wait for empty lines in the script file, in seconds.
Width of the terminal, in number of characters.
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 of the cast, this is included in the cast JSON file.
Time stamp of the recording, defaults to Sys.time()
,
this is included in the cast JSON file.
Environment variables to include in the case JSON file.
Defaults to list(TERM = "xterm-256color", SHELL = "/bin/zsh")
.
Time limit for the cast not printing anything, in seconds. By default there is no limit.
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.
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.
Delay at the beginning, in seconds.
Delay at the very end, in seconds.
Environment variables to set for the R subprocess.
Quoted language object to run in the subprocess before starting the recording.
Whether to echo the input to the terminal. If FALSE
, then
only the output is shown.
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.
An asciicast
object, write this to
file with write_json()
.
Other asciicast functions:
asciicast-package
,
asciicast_start_process()
,
read_cast()
,
write_json()
# NOT RUN {
script <- system.file("examples", "hello.R", package = "asciicast")
cast <- record(script)
play(cast)
# }
Run the code above in your browser using DataLab