Cast files
Reference docs
Asciicast.Header — Type
Base.@kwdef struct Header
version::Int=2
width::Int=80
height::Int=24
timestamp::Union{Int, Nothing}=floor(Int, datetime2unix(now()))
duration::Union{Float64, Nothing}=nothing
idle_time_limit::Union{Float64, Nothing}=nothing
command::Union{String, Nothing}=nothing
title::Union{String, Nothing}=nothing
env::Union{Dict{String, String},Nothing}=Dict{String, String}("SHELL" => get(ENV, "SHELL", "/bin/bash"))
theme::Union{Dict{String, String},Nothing}=nothing
term_type::Union{String, Nothing}=get(ENV, "TERM", "xterm-256color")
term_version::Union{String, Nothing}=nothing
tags::Union{Vector{String}, Nothing}=nothing
endThe header of an asciicast file, for both the v2 and v3 formats. Fields set to nothing are omitted when the header is written.
version selects the format used when a Cast is written: 2 (the default) or 3. parse_cast sets it to the version of the file it reads.
The fields correspond to the two formats as follows:
widthandheightarewidthandheightin v2, andterm.colsandterm.rowsin v3.themeisthemein v2, andterm.themein v3.term_typeisterm.typein v3. v2 has no such field, so it is written asenv["TERM"]ifenvis notnothingand has noTERMentry, and read fromenv["TERM"](removing it fromenv).term_versionandtagsexist only in v3, and are not written to v2 files.durationexists only in v2, and is not written to v3 files.- The other fields have the same name in both formats.
Asciicast.EventType — Type
Asciicast.EventTypeAn enum of asciicast event types:
Asciicast.OutputEvent(code"o")Asciicast.InputEvent(code"i")Asciicast.MarkerEvent(code"m")Asciicast.ResizeEvent(code"r", data"{COLS}x{ROWS}")Asciicast.ExitEvent(code"x", data is the exit status; defined in asciicast v3)
write_event! writes a lone in the data of OutputEvent and InputEvent as , and writes the data of the other types unchanged.
Asciicast.Event — Type
struct Event
time::Float64
type::EventType
event_data::String
endRepresents an event in a cast file. time is the time in seconds since the start of the recording, for both v2 and v3 casts (v3 files store the interval since the previous event; parse_cast and write_event! convert between the two). event_data is kept as read by parse_cast; write_event! normalises line endings in the data of output and input events only. See also EventType.
Asciicast.parse_cast — Function
Asciicast.parse_cast(io::IO) -> header, eventsReturns a tuple consisting of a Header and vector of Event's.
Both asciicast v2 and v3 files are supported. For v3 files, event intervals are converted to times since the start of the recording, and lines starting with # (comments) are skipped. See Header for how the header fields of each version are read. Empty lines and events with unknown event codes are skipped, as required by both specifications.