App::Textcast - Light weight text casting
use App::Textcast qw(record_textcast play_textcast) ; record_textcast(COMMAND => 'bash') ; play_textcast(TEXTCAST_DIRECTORY => $input_directory) ;
What's a textcast?
It's a screencast of a terminal session. The idea is to record the terminal session and replay it in another terminal without loosing resolution, as screencasts do, nor using much disk space due to conversion from text to video. The terminal session can run a shell or any other program.
Why textcasts?
Size, I did a screen cast of a completion script, the size was 1.5 MB and it didn't look as good as the terminal. The same textcast was 10 KB (yes, 10 Kilo Bytes) and it looked good.
It is not possible to make a screencast of a real terminal, maybe via vnc but that's already too complicated
Documentation. I believe it is sometimes better to show "live" documentation than static text. I am planning to write a module that plays a textcast embedded in ones terminal. The text cast being controlled by the application that displays help. I also believe that it could be used as a complement to showing static logs or screenshots; an example is when someone describe a problem on IRC. Seeing what is being done is sometimes very helpful.
Editing. possibility to add message possibility to add sound possibility to extend the time an image or a range of images is displayed concatenate text casts (and their indexes) remove portions of a text cast name part of the text cast (shows in the index)
See record_textcast and play_textcast subbroutines.
Two commands, record_textcast and play_textcast, are installed on your computer when you install this module. Use them to record and replay your text casts.
The textcast is a serie of files recorded in a directory. Tar/gzip the files before you send them. the compression ratio averages 95%.
Records the terminal output of a command. The output is stored as a set of files in a directory. The directory is later passed as argument to play_textcast for display.
use App::Textcast 'record_textcast' ; record_textcast ( COMMAND => 'bash', OUTPUT_DIRECTORY => shift @ARGV, COMPRESS => $compress, COLUMNS => $columns, ROWS => $rows, ) ;
Arguments
The arguments are named, order is not important.
COMMAND => $string - the name of the command to tun in a terminal. You most probably wan to run bash or sh
OUTPUT_DIRECTORY => $directory_path - Optional - the path to the directory where the textcast is to be recorded. This subroutine will create a directory if this option is not set. if this option is set, the directory should not exist.
COMPRESS => $boolean - Not implemented
COLUMNS => $integer - Optional - Number of columns in the terminal. The current terminal columns number is used if this argument is not set.
ROWS => $integer - Optional - Number of rows in the terminal. The current terminal rows number is used if this argument is not set.
Returns - Nothing
Exceptions
See check_output_directory
see create_vt102_sub_process
disk full error
See scripts/record_textcast.
Check that the given output directory does not exist. If $output_directory is not defined, a directory name is generated.
$output_directory - The name of the directory where the textcast is recorded
Returns - The directory where the textcast is recorded.
Textcast directory already exists
Path too long - length must be under 256 characters.
Invalid path - Path can only contain alphanumerics and path separator.
Loads, checks, and initiates the textcast replay. Displays information after the textcast replay.
use App::Textcast 'play_textcast' ; play_textcast ( TEXTCAST_DIRECTORY => $input_directory, OVERLAY_DIRECTORY => $overlay_directory, DISPLAY_STATUS => $display_status, START_PAUSED => $start_paused, ) ;
TEXTCAST_DIRECTORY - String - directory containing the textcast
OVERLAY_DIRECTORY - not implemented
DISPLAY_STATUS - Boolean -
START_PAUSED - not implemented
Terminal too small
interrupted by user
load_index
Plays a screencast.
$input_directory - String - directory containing the textcast
\@screenshot_information - see load_index
\%display_status -
Returns - A list containing
$total_play_time
$played_frames
\@skipped_frames
Exceptions - None
Displays information about the textcast replay.
print_play_information ( $total_play_time, $total_frames, $played_frames, \@skipped_frames, ) ;
$total_play_time - Float - play time in seconds
$played_frames - Integer - number of framed played, maybe less than $total_frames
\@skipped_frames - Integer - number of frames skipped because they couldn't be found
Displays a status on the status line.
$status - String to be displayed on the terminal
$status_row - Integer - row position for the status
$status_column - Integer - column position for the status
Create an ANSI command to position the cursor on the terminal.
$row - Integer - row position for the status
$column - Integer - column position for the status
Returns - A string containing the ANSI command.
See xxx.
xxx
Loads the screencast meta-data.
$input_directory - The directory containing the textcast
Returns - The screencast meta-data, see the index file for format information.
Index not found
Invalid data in index
$shell_command, $columns, $rows -
Returns - a vt_process handle
$vt_process - vt_process handle created by create_vt102_sub_process
Returns - $vt, $terminal_change_buffer
Callback for OUTPUT events - for Term::VT102.
Exceptions - Nothing
See Term::VT102.
Callback for ROWCHANGE events. This just sets a time value for the changed row using the private data as a hash reference - the time represents the earliest that row was changed since the last screen update.
Callback to trigger a full-screen repaint.
Creqtes a child process to run a command in.
Exceptions - Can not fork to run sub process
Exceptions - Error redirecting streams
Check the sub process output.
$vt_process -
Returns - $eof, $screen_data, $cursor_x, $cursor_y
None so far.
Nadim ibn hamouda el Khemir CPAN ID: NH mailto: nadim@cpan.org
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
You can find documentation for this module with the perldoc command.
perldoc App::Textcast
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/App-Textcast
RT: CPAN's request tracker
Please report any bugs or feature requests to L <bug-app-textcast@rt.cpan.org>.
We will be notified, and then you'll automatically be notified of progress on your bug as we make changes.
Search CPAN
http://search.cpan.org/dist/App-Textcast
screen (1), script(1), aewan, vte(1), evilvte(1).
To install App::Textcast, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Textcast
CPAN shell
perl -MCPAN -e shell install App::Textcast
For more information on module installation, please visit the detailed CPAN module installation guide.