class Opal::Asciicast::Writer

Overview

Generates standard Asciinema v2 format recordings (.cast). Spec: https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md

Defined in:

opal/asciicast/writer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(width : Int32 = 80, height : Int32 = 24, title : String = "Opal Demo", term : String = "xterm-256color", shell : String = "/bin/bash", theme : Hash(String, String) | Nil = nil, idle_time_limit : Float64 | Nil = nil) #

[View source]

Instance Method Detail

def clear_screen(advance : Float64 = 0.02) : Nil #

Clears the terminal screen and homes the cursor


[View source]
def current_time : Float64 #

[View source]
def draw_buffer(buf : UI::Buffer, advance : Float64 = 0.05) : Nil #

Draws a full Buffer into the cast without clearing the screen, ensuring flicker-free terminal updates with full ANSI color styling.


[View source]
def elapsed : Float64 #

[View source]
def events : Array(Event) #

[View source]
def header : Header #

[View source]
def height : Int32 #

[View source]
def move_to(row : Int32, col : Int32, advance : Float64 = 0.01) : Nil #

Moves cursor to row, col


[View source]
def pause(seconds : Float64) : Nil #

Pauses playback by advancing elapsed time


[View source]
def save(filename : String) : Nil #

Saves the asciicast file (UTF-8 without BOM)


[View source]
def title : String #

[View source]
def to_s(io : IO) : Nil #

Generates the complete .cast file contents as a string


[View source]
def type_text(text : String, cps : Float64 = 16.0, jitter : Float64 = 0.02) : Nil #

Simulates human typing cadence for a string


[View source]
def width : Int32 #

[View source]
def write(data : String, advance : Float64 = 0.05) : Nil #

Writes an output event [time, "o", data] with a time advance


[View source]
def write_input(data : String, advance : Float64 = 0.0) : Nil #

Writes an input event [time, "i", data]


[View source]
def write_marker(label : String, advance : Float64 = 0.0) : Nil #

Writes a marker event [time, "m", label]


[View source]