Raxol.Recording.Asciicast
(Raxol v2.3.0)
View Source
Serializes and deserializes asciinema v2 .cast files.
The asciicast v2 format is:
- Line 1: JSON header with version, width, height, timestamp, env
- Remaining lines:
[elapsed_seconds, "o", "output_data"](newline-delimited JSON)
Summary
Functions
Decodes an asciicast v2 format string into a session.
Encodes a session to asciicast v2 format string.
Reads a .cast file into a session. Returns {:ok, session} or {:error, reason}.
Reads a .cast file into a session. Raises on failure.
Writes a session to a .cast file.
Functions
@spec decode(String.t()) :: Raxol.Recording.Session.t()
Decodes an asciicast v2 format string into a session.
@spec encode(Raxol.Recording.Session.t()) :: String.t()
Encodes a session to asciicast v2 format string.
@spec read(Path.t()) :: {:ok, Raxol.Recording.Session.t()} | {:error, term()}
Reads a .cast file into a session. Returns {:ok, session} or {:error, reason}.
@spec read!(Path.t()) :: Raxol.Recording.Session.t()
Reads a .cast file into a session. Raises on failure.
@spec write!(Raxol.Recording.Session.t(), Path.t()) :: :ok
Writes a session to a .cast file.