Skip to content
ConsoleMonster
Class

Recording

ConsoleMonster.Export

Namespace
ConsoleMonster.Export
Assembly
ConsoleMonster
Modifiers
static

Exports JSON-lines recordings (written by a live session with a recorder) to an animated SVG (CSS keyframes, no script), a self-contained HTML player (play/pause, speed, scrubbing) or asciicast v3 for standard players. A recording holds updates, not pictures, so it is played into the widget tree it was recorded from (the same dashboard definition) at a fixed size and frame rate.

Inheritance

  • object
  • Recording

Methods

public static List<RecordedFrame> CaptureFrames(IWidget root, IEnumerable<LiveEvent> events, RecordingExportOptions? options = null) #

Replays dashboard events into distinct timed cell grids for image add-ons and other consumers.

Parameters

root ConsoleMonster.Layout.IWidget required
events System.Collections.Generic.IEnumerable<ConsoleMonster.Live.LiveEvent> required
options ConsoleMonster.Export.RecordingExportOptions? = null optional

Returns

List<RecordedFrame>
Render 3 overloads
public static RenderedOutput Render(IWidget root, TextReader jsonLines, OutputFormat format, RecordingExportOptions? options = null) #

Renders a recording file in a format.

Parameters

root ConsoleMonster.Layout.IWidget required
The dashboard the events were recorded from.
jsonLines System.IO.TextReader required
The recording (JSON lines).
format ConsoleMonster.Export.OutputFormat required
Html, Svg, Asciicast or Text.
options ConsoleMonster.Export.RecordingExportOptions? = null optional
Pacing, theme and player settings.

Returns

RenderedOutput The rendered output.
public static RenderedOutput Render(IWidget root, IEnumerable<LiveEvent> events, OutputFormat format, RecordingExportOptions? options = null) #

Renders recorded events in a format.

Parameters

root ConsoleMonster.Layout.IWidget required
The dashboard the events were recorded from.
events System.Collections.Generic.IEnumerable<ConsoleMonster.Live.LiveEvent> required
The events.
format ConsoleMonster.Export.OutputFormat required
Html, Svg, Asciicast or Text.
options ConsoleMonster.Export.RecordingExportOptions? = null optional
Pacing, theme and player settings.

Returns

RenderedOutput The rendered output.
public static RenderedOutput Render(IReadOnlyList<RecordedFrame> frames, OutputFormat format, RecordingExportOptions? options = null) #

Renders recorded frames in a format.

Parameters

frames System.Collections.Generic.IReadOnlyList<ConsoleMonster.Export.RecordedFrame> required
The frames.
format ConsoleMonster.Export.OutputFormat required
Html, Svg, Asciicast or Text.
options ConsoleMonster.Export.RecordingExportOptions? = null optional
Pacing, theme and player settings.

Returns

RenderedOutput The rendered output.
public static void Save(IWidget root, string recordingPath, string outputPath, OutputFormat? format = null, RecordingExportOptions? options = null) #

Exports a recording file to another file (UTF-8 without a byte order mark).

Parameters

root ConsoleMonster.Layout.IWidget required
The widget tree the recording was made with.
recordingPath string required
The .jsonl recording.
outputPath string required
The output file.
format ConsoleMonster.Export.OutputFormat? = null optional
The format; null picks it from the output extension (.html, .svg, .cast; .json writes player data).
options ConsoleMonster.Export.RecordingExportOptions? = null optional
The options.
public static string ToAsciicast(IWidget root, TextReader jsonLines, RecordingExportOptions? options = null) #

Exports a recording as asciicast v3.

Parameters

root ConsoleMonster.Layout.IWidget required
The widget tree the recording was made with.
jsonLines System.IO.TextReader required
The recording.
options ConsoleMonster.Export.RecordingExportOptions? = null optional
Size, frame rate and theme.

Returns

string The asciicast lines.
public static string ToHtml(IWidget root, TextReader jsonLines, RecordingExportOptions? options = null) #

Exports a recording as an HTML player.

Parameters

root ConsoleMonster.Layout.IWidget required
The widget tree the recording was made with.
jsonLines System.IO.TextReader required
The recording.
options ConsoleMonster.Export.RecordingExportOptions? = null optional
Size, frame rate, theme and window frame.

Returns

string The HTML.
ToPlayerData 2 overloads
public static string ToPlayerData(IWidget root, TextReader jsonLines, RecordingExportOptions? options = null) #

Exports a recording as player data (JSON) for the native player (ConsoleExporter.PlayerScript), so a site includes the script once and points any number of players at their data instead of embedding whole pages. The data holds the distinct rows as HTML, each frame as its start time and row numbers, and the screen CSS (scoped to its player by the script). It is safe to embed in a script type="application/json" element.

Parameters

root ConsoleMonster.Layout.IWidget required
The widget tree the recording was made with.
jsonLines System.IO.TextReader required
The recording.
options ConsoleMonster.Export.RecordingExportOptions? = null optional
Size, frame rate, theme and window frame.

Returns

string The JSON.
public static string ToPlayerData(IWidget root, IEnumerable<LiveEvent> events, RecordingExportOptions? options = null) #

Exports recorded events as player data (JSON); see Recording.ToPlayerData.

Parameters

root ConsoleMonster.Layout.IWidget required
The widget tree the events address.
events System.Collections.Generic.IEnumerable<ConsoleMonster.Live.LiveEvent> required
The events, in order, with their times.
options ConsoleMonster.Export.RecordingExportOptions? = null optional
Size, frame rate, theme and window frame.

Returns

string The JSON.
public static string ToSvg(IWidget root, TextReader jsonLines, RecordingExportOptions? options = null) #

Exports a recording as an animated SVG.

Parameters

root ConsoleMonster.Layout.IWidget required
The widget tree the recording was made with.
jsonLines System.IO.TextReader required
The recording.
options ConsoleMonster.Export.RecordingExportOptions? = null optional
Size, frame rate, theme and window frame.

Returns

string The SVG.