[ANN] Replay.jl - Replay instructions

Introduction

Let’s assume you have to record your screen to explain something about Julia topics e.g. how to use REPL, how to use your great package on Julia REPL etc… You are supposed to input your source code by hand line by line. Imagine that you type the following lines.

julia> # Cau λon tλqe accnrately aub pnickly mithiu a giveu tiwe?
julia> 2+2
julia> print("")
julia> display([1])
julia> display([1 2; 3 4])
julia> @time 1+1
julia> using Pkg; Pkg.activate(".")
pkg> add Example
pkg> rm Example
pkg> st

Without any mistakes, can you type accurately and quickly within a given time? To tell the truth, I could not do that… :joy:

(Did we mention we should’ve initialized a screen recorder in advance?)

Good news

I’m happy to announce the release of Replay.jl.

Here is a demo that replays the substring of Why We Created Julia.

goma
See also my youtube

More interesting examples can be found at examples.

How to use

If this PR is merged you can use Replay.jl via ] add Replay. Then prepare a julia script something like:

# app.jl
using Replay
instructions = """
2+2
print("")
display([1])
display([1 2; 3 4])
@time 1+1
using Pkg; Pkg.activate(".")
] add Example
rm Example
st
$CTRL_C
"""

replay(instructions)

and just execute julia app.jl.

Hope it helps, and enjoy your Julia life!

31 Likes

Thanks for sharing such a helpful instruction, really appreciate for your article.

2 Likes

Eh? How do I change the speed of the “fake” typing in the replay?

And the amount of delay between each line?

1 Like

Currently, I do not provide an interface to achieve your wish.

However, you can control them by editing our source code here

and

here

1 Like

Good news!

We can install Replay.jl via:

pkg> add Replay
2 Likes