Call this function in your Rmd file, to enable creating asciinema casts from code chunks.
init_knitr_engine(
echo = FALSE,
same_process = TRUE,
timeout = 10,
allow_errors = TRUE,
startup = NULL,
record_env = NULL,
echo_input = TRUE,
options = asciicast_knitr_options()
)
Whether to print the code of asciicast chunks.
Whether to run all asciicast chunks in the same
R process. To restart this R process, call init_knitr_engine()
again.
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.
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.
Quoted language object to run in the subprocess before starting the recording.
Environment variables to set for the R subprocess.
Whether to echo the input in the asciicast recording.
R options to set (via base::options()
, in the background
R process that performs the recording. See asciicast_knitr_options()
for the defaults.
Call this function from an Rmd chunk and then you can use the asciicast knitr engine:
```{r echo = FALSE, results = "hide"} asciicast::init_knitr_engine() ```
```{asciicast, cache = TRUE}` #' Rows: 10 # This is an asciicast example loadedNamespaces() ```
Other asciicast in Rmd:
asciicast_knitr_options()