Giter Club home page Giter Club logo

trecs's Introduction

T-Recs

Build State https://travis-ci.org/iachettifederico/trecs.svg

                __________
               /  o       \
               |      ____|
               |     |___
               |    ____/
              _|   |
            _|     |===E
   /\     _|       ===E
   \ \___|         |
    \___          /
 _____ ____     _/
|_   _|  _ \ ___  ___ ___
  | | | |_) / _ \/ __/ __|
  | | |  _ <  __/ (__\__ \
  |_| |_| \_\___|\___|___/

Record screencasts in plain text.

Installing TRecs

To install TRecs, just run

gem install trecs

Usage

Reproduce a TRecs

You have a TRecs file and want to reproduce it? You can do it on a terminal using the trecs command.

Like this:

trecs <file>

You can also specify the refresh interval for the screen (terminal), using the --step argument. The value has to be an integer representing the amount of milliseconds between each screen refresh.

trecs <file> --step=800
trecs <file> -s 800

Recording a TRecs

Wanna record a TRecs? Do it using the trecs_record command.

There are several recording plugins available for use

Each options has a set of available flags (NOTE: the --help argument don’t explain each one in detail yet)

The main option to select the recording alternative is the Recording Strategy, passed to TRecs via the --strategy (-s) argument.

Here it’s also available the --step option, which will define the time between frames in milliseconds.

Terminal session

The most obvious use for this gem is recording a terminal session. This feature will be the default in the future, but it’s not fully implemented yet.

To record a terminal session, use the --strategy=ttyrec option:

trecs_record playing_with_bash.trecs --strategy=ttyrec

This will open a new terminal session to record. You can finish the recording typing exit or pressing C-d, then the session will be saved to playing_with_bash.trecs and will be ready for replaying.

Record a file’s changes

You can record the changes that occur on a file by using --strategy=raw-file.

What this does is sample a file every step milliseconds and create a frame with that file’s contents.

To use it:

trecs_record my_changes.trecs --strategy=raw_file

Incremental message TRecs

Another possibility is to record a text message that will appear on screen character by character with an interval of step milliseconds. This is currently the default functionality of the command trecs_record

trecs_record my_banner.trecs --strategy=incremental --step=50 --message="TRecs"

This will create 6 frames:

0 millis
””
50 millis
“T”
100 millis
“TR”
150 millis
“TRe”
200 millis
“TRec”
250 millis
“TRecs”

Fly from right

Insert a message and se it fly from the right side of the screen

trecs_record my_banner.trecs --strategy=fly_from_right --step=50 --message="TRecs"

Shell command for message

On some recording strategies, there’s also the posibility to run a custom shell command for each frame.

For example, you can use the wc shell command to count the characters (or lines or words) of a banner that, for example appears one char at the time

trecs_record my_banner.trecs --strategy=incremental --step=50 --message="TRecs" --command="echo <frame> | wc -c"

This will run, for each frame the command <frame> | wc -c

Where <frame> will be eplaced by the frame contents inside double quotes

And these are the generated frames with its corresponding commands:

0 millis
frame
0
        
command
echo "" | wc -c
        
50 millis
frame
1
        
command
echo "T" | wc -c
        
100 millis
frame
2
        
command
echo "TR" | wc -c
        
150 millis
frame
3
        
command
echo "TRe" | wc -c
        
200 millis
frame
4
        
command
echo "TRec" | wc -c
        
250 millis
frame
5
        
command
echo "TRecs" | wc -c
        

Currently applies to:

  • Incremental Strategy
  • Fly from right Strategy

Extending TRecs

Right now, you can extend TRecs in three possible ways

Recording Strategies
This is the object that defines what to record and how to process the input to be converted into frames. To give an example, the IncrementalStrategy (provided by TRecs), will take an input string, make an array with each of it’s characters and, for each char, append it to an output string and save the frame.
Formats
The format corresponds to the way the frames are stored. For example, using YamlStore, a tar file or a database.
Tickers
The Ticker is the way the user tells TRecs to advance frames.

trecs's People

Contributors

iachettifederico avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.